matlab中for语句画图,Subscript indices must either be real positive integers or logicals.for ii=0.1:1x=0:100y(ii)=(L-ii*hg)/(ii*hg)*x-G*b/hg;plot(x,y(ii))hold onend出现Subscript indices must either be real positive integers or logicals.这个

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 15:01:43
matlab中for语句画图,Subscript indices must either be real positive integers or logicals.for ii=0.1:1x=0:100y(ii)=(L-ii*hg)/(ii*hg)*x-G*b/hg;plot(x,y(ii))hold onend出现Subscript indices must either be real positive integers or logicals.这个

matlab中for语句画图,Subscript indices must either be real positive integers or logicals.for ii=0.1:1x=0:100y(ii)=(L-ii*hg)/(ii*hg)*x-G*b/hg;plot(x,y(ii))hold onend出现Subscript indices must either be real positive integers or logicals.这个
matlab中for语句画图,Subscript indices must either be real positive integers or logicals.
for ii=0.1:1
x=0:100
y(ii)=(L-ii*hg)/(ii*hg)*x-G*b/hg;
plot(x,y(ii))
hold on
end
出现Subscript indices must either be real positive integers or logicals.
这个什么情况啊

matlab中for语句画图,Subscript indices must either be real positive integers or logicals.for ii=0.1:1x=0:100y(ii)=(L-ii*hg)/(ii*hg)*x-G*b/hg;plot(x,y(ii))hold onend出现Subscript indices must either be real positive integers or logicals.这个
很简单, ii=0.1:1的结果其实就是ii=0.1,那么表达式y(ii)就是用0.1当数组的下标,而数组下标只能是正整数或逻辑数组,不能是小数.