Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Got an indexing error here. Please recommend an answer.

1 visualización (últimos 30 días)
Virajan Verma
Virajan Verma el 16 de Oct. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
for i=1:9
N_matrix(1,i)=N(rem(i,3))*ex(i)/3; %(ERROR HERE)
end
Attempted to access N(0); index must be a positive integer or logical.
Error in practisee2 (line 227)
N_matrix(1,i+1)=N(rem(i+1,3))*ex(i+1)/3;
  10 comentarios
KSSV
KSSV el 16 de Oct. de 2018
N is a matrix formed from Shape functions. It is related FEM (Finite Element Method) stuff.
madhan ravi
madhan ravi el 16 de Oct. de 2018
thank you @KSSV

Respuestas (1)

Walter Roberson
Walter Roberson el 16 de Oct. de 2018
N_matrix(1,i)=N(rem(i-1,3)+1)*ex(i)/3; %(ERROR HERE)
  3 comentarios
KSSV
KSSV el 16 de Oct. de 2018
Will this expression will result in the same output ..You try....play with values see the output..make a note..change the values....compare the output...remember you are learning..this is the way to learn.
Walter Roberson
Walter Roberson el 16 de Oct. de 2018
"Will this expression will result in the same output??"
No. Your original expression outputs an error message, whereas my proposed expression will execute.

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by