Variable for a matrix
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Damith
el 20 de Mayo de 2014
Comentada: Damith
el 20 de Mayo de 2014
Hi,
I have to find mean from Trans1WW to Trans39WW. So, how can i make a variable so that I can include in a for loop.
St1_WW_avg=mean(Trans1WW);
Thanks.
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 20 de Mayo de 2014
Editada: Azzi Abdelmalek
el 20 de Mayo de 2014
for k=1:39
eval(sprintf('St1_WW_avg(%d)=mean(Trans%dWW)',k,k));
end
You shouldn't use all these variables, it's better to used one cell array containing all your variables.Look at
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!