save file with loop index in matlab
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
want to save some variables in matlab program like
for i =1:10
x(i)=randn()*5;
save(i,x(i));
end
At every iteration 'i' I want it save the values of x(i), but matlab gives me the error "Error using save Must be a string scalar or character vector." How can I solve this
2 comentarios
the cyclist
el 25 de Abr. de 2022
When you say "save", do you mean save workspace variables to a file (which is what the save command does)? Or do you mean something else?
Are you trying to save 10 different random values to 10 different files?
Respuestas (1)
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!