saving set of vectors in (.mat) file

8 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2013-2-26
  3 个评论
Walter Roberson
Walter Roberson 2013-2-26
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?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by