Borrar filtros
Borrar filtros

saving set of vectors in (.mat) file

8 visualizaciones (últimos 30 días)
Nermeen alami
Nermeen alami el 26 de Feb. de 2013
hi
i want to save multiple vectors in a .mat file in order to have a (15*19) array- i mean i want to have many vectors within for loop how can i do that this is the code i used:
hhist=hist(h(:), numberofbins);
shist=hist(s(:), numberofbins);
vhist=hist(v(:), numberofbins);
vector = [hhist, shist, vhist, status];
save(savefile, 'vector');
thank u all
  1 comentario
Image Analyst
Image Analyst el 26 de Feb. de 2013
What in that code do you expect to be 15 by 19? What does the 15 represent, and what does the 19 represent? Where is the for loop?

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 26 de Feb. de 2013
  3 comentarios
Nermeen alami
Nermeen alami el 26 de Feb. de 2013
it works thanks :)
Walter Roberson
Walter Roberson el 26 de Feb. de 2013
In order to save multiple vectors into a .mat file without having the variables write over each other, each of the variables needs to have a different name. The FAQ above describes how to work with variable names whose names themselves change during a loop.
Have you considered the alternatives, such as creating a single variable that holds all of the results, and saving that one variable after the loop?

Iniciar sesión para comentar.

Más respuestas (0)

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!

Translated by