Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
Vikram Anand
Vikram Anand el 24 de Jul. de 2019
Comentada: Walter Roberson el 24 de Jul. de 2019
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 comentario
Walter Roberson
Walter Roberson el 24 de Jul. de 2019
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.

Iniciar sesión para comentar.

Respuesta aceptada

madhan ravi
madhan ravi el 24 de Jul. de 2019
No loop is needed:
R1=(t*(Dq./Dz)) ./ (Qa.*((Du./Dz).^2+(Dv./Dz).^2));
R2 = R1(:)

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by