Indexing and Iteration issues

Input:
for j=1:NS
tsr(j)=((r(j)*rot)/v); %TSR
end
For loop iteration
X(j) requires tsr(j) and a(j).
Both X(j) and a(j) changes every loop.
Before, I use X1(i-1), X2 (i-1).
After receiving suggestions from this forum to use indexing instead, I revised the code using indexing (still a newbie ^^,)
Any idea on how to approach this? It seems I have to deal with X(j,i-1) where j, indexes to 20 variables (equal to X1,X2, X20) and i has something to do with iteration.
Kind regards,
Wes

5 comentarios

migs
migs el 26 de Abr. de 2017
I followed that sir! the next problem is the indexing and the iteration part. since the variables within the iteration loop have to be indexed as well, hence the confusion.
migs
migs el 26 de Abr. de 2017
for instance, phi is within the iteration loop. instead of phi1(i-1), phi2(i-1), phi has to be indexed. the problem now moves on to the iteration procedure. could I use two for loops? I'm wondering what will be their respective index will look like.
Greg Dionne
Greg Dionne el 27 de Abr. de 2017
Editada: KSSV el 28 de Abr. de 2017
Stephen23
Stephen23 el 28 de Abr. de 2017
Editada: Stephen23 el 28 de Abr. de 2017

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 26 de Abr. de 2017

Editada:

el 28 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by