MATLAB function numpositivi=es1(flussi)nf=numel(flussi); numpositivi=0; for i=1:nf if flussi(i)>0 � numpositivi=numpositivi+1end end检验> V=[1 -2 4 -2 -8 -5 6 8 10]V =1 -2 4 -2 -8 -5 6 8 10>> es1(V)Subscript indices must either be real posit
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 06:47:29
MATLAB function numpositivi=es1(flussi)nf=numel(flussi); numpositivi=0; for i=1:nf if flussi(i)>0 � numpositivi=numpositivi+1end end检验> V=[1 -2 4 -2 -8 -5 6 8 10]V =1 -2 4 -2 -8 -5 6 8 10>> es1(V)Subscript indices must either be real posit
MATLAB
function numpositivi=es1(flussi)
nf=numel(flussi);
numpositivi=0;
for i=1:nf
if flussi(i)>0 �
numpositivi=numpositivi+1
end
end
检验
> V=[1 -2 4 -2 -8 -5 6 8 10]
V =
1 -2 4 -2 -8 -5 6 8 10
>> es1(V)
Subscript indices must either be real positive integers or logicals.
MATLAB function numpositivi=es1(flussi)nf=numel(flussi); numpositivi=0; for i=1:nf if flussi(i)>0 � numpositivi=numpositivi+1end end检验> V=[1 -2 4 -2 -8 -5 6 8 10]V =1 -2 4 -2 -8 -5 6 8 10>> es1(V)Subscript indices must either be real posit
我估计我可能找到原因了
运行es1(V)语句之前
加一句
clearvars es1