早教吧作业答案频道 -->其他-->
Matlab报错为Attemptedtoaccessf(64.4);indexmustbeapositiveintegerorlogical.编码如下:forx=11,11;190;64.4;37.25;110;11;8.3;9.1;41.5;y=f(x);ifx=110f(x)=0;endenddisp(y)
题目详情
Matlab 报错为Attempted to access f(64.4); index must be a positive integer or logical.
编码如下:
for x=11,11;190;64.4;37.25;110;11;8.3;9.1;41.5;
y=f(x);
if x=110
f(x)=0;
end
end
disp(y)
编码如下:
for x=11,11;190;64.4;37.25;110;11;8.3;9.1;41.5;
y=f(x);
if x=110
f(x)=0;
end
end
disp(y)
▼优质解答
答案和解析
你的脚本里f是一个数组,把f定义成一个带参数的函数就行了.
看了 Matlab报错为Attem...的网友还看了以下:
口算22×40=9+14=120÷6=300+400=56÷8+3=56÷7=46+24=15+1 2020-04-07 …
Matlab报错为Attemptedtoaccessf(64.4);indexmustbeapos 2020-05-17 …
口算22×40=9+14=120÷6=300+400=56÷7=46+24=15+15=60×30 2020-07-09 …
(1)2005-999=(2)0.25+15−920=(3)34÷0.75×2=(4)(12+13 2020-07-09 …
急,几道解方程1.-2x+1=02.-5x=703.-3/5x-8=14.0.2x-5=-35.-2 2020-10-31 …
Matlab报错为Attemptedtoaccessf(64.4);indexmustbeaposi 2020-11-01 …
合理、灵活地计算25×1.25×32(110+16)×10×6(12-38)÷(4÷815)[12- 2021-01-07 …