필터 지우기
필터 지우기

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 CenterFile Exchange에서 Statistics 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