Error: ()-indexing must appear last in an index expression.
1 次查看(过去 30 天)
显示 更早的评论
clc
clear all
g=xlsread('try22.xlsx');
Dq=g(:,8);
Dz=g(:,9);
Du=g(:,10);
Dv=g(:,11);
Qa=g(:,12);
t=9.81;
R2=[ ];
for i=1:length(g)
R1(i)=(t*(Dq(i)/Dz(i)))/(Qa(i)((Du(i)/Dz(i))^2+(Dv(i)/Dz(i))^2))
R2=[R2;R1(i)];
end
1 个评论
Walter Roberson
2019-7-24
The fragment
(Qa(i)((Du(i)/Dz(i))^2
Has no operation between Qa(i) and what follows.
Madhan assumes that multiplication was intended, which is plausible.
采纳的回答
madhan ravi
2019-7-24
No loop is needed:
R1=(t*(Dq./Dz)) ./ (Qa.*((Du./Dz).^2+(Dv./Dz).^2));
R2 = R1(:)
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!