フィルターのクリア

Error: ()-indexing must appear last in an index expression.

1 回表示 (過去 30 日間)
Vikram Anand
Vikram Anand 2019 年 7 月 24 日
コメント済み: Walter Roberson 2019 年 7 月 24 日
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
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
madhan ravi 2019 年 7 月 24 日
No loop is needed:
R1=(t*(Dq./Dz)) ./ (Qa.*((Du./Dz).^2+(Dv./Dz).^2));
R2 = R1(:)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by