Save many vectors in one file
Show older comments
Hi
I want to do the following:
(1) I get a lot of vectors, size [80,1] (2) This vectors should saved in a file or a workspace variable (3) but it shouldn't save [80,1],[80,1],[80,1],... it should save all as one big vektor with all elements in a row...
how can i do this?
Thx for any help.
Answers (2)
a=rand(10,1); % first vector
b=rand(10,1); % second vector
c=rand(10,1); % third vector
out=[a b c] % combined matrix of above vectors
savename='test.mat';
save(savename,'out') % save the combined vector out in test.mat
Jan
on 6 Dec 2012
"I get a lot of vectors" does not reveal, how these vectors are stored. If you store them in the columns of a [80 x n] matrix, the question is solved already. If you store them in a {1 x n} cell, simply run:
M = cat(1, C{:});
If you store them in another format, please explain this, because we cannot guess such details.
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!