calling a matrix with different names in a for loop
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yaser Khojah
el 5 de Sept. de 2019
Comentada: Yaser Khojah
el 5 de Sept. de 2019
I have three matrixes with different names as NPV_1, NPV2 and NPV_3. I have tried the below but It did not work. Can you please help
for i = 1:3
fm =forfor sprintf('NPV_%d',i);
NPV_Mat = fm;
end
2 comentarios
Stephen23
el 5 de Sept. de 2019
"I have three matrixes with different names as NPV_1, NPV2 and NPV_3"
Accessing separate variable names like that is one way that beginners force themselves into writing slow, complex, obfuscated, buggy code that is hard to debug. Read this to know why:
Respuesta aceptada
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!