ERROR: array indices must be positive integers or logical values
显示 更早的评论
The program does not graph the temr function, only recognize tem function and always shows the same error in temr line(Array indices must be positive integers or logical values)
U=220;f=50;p=3;R1=4;R2=4;X1=6;X2=6;m=3;
n1=60*f/p;
s=0.001:0.001:1;
n=(1-s)*n1;
R2r=R2+46;
Tem=@(s)((m*p*U^2*R2./s)./(2*pi*f*((R1+R2./s).^2+(X1+X2)^2)));
Temr=@(s,R2r)((m*p*U^2*R2r./s)./(2*pi*f((R1+R2r./s).^2+(X1+X2)^2)));
plot(Tem(s),n,'r');
xlabel('Tem/n*m');
ylabel('n/r/min');
hold on;
plot(Temr(s,R2r),n,'b');
legend('After Regulation','Before Regulation');
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Vehicle Dynamics Blockset 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!