database - writing cell array into text file and managin the variables in import wizard -
i have cell array of matrices
my_cell = [3 x 3] [3 x 3] [3 x 3]
after writing text file dlmwrite
, need import data import wizard in way my_cell(1,1)
first variable, my_cell(1,2)
second , my_cell(1,3)
third one.
this code:
v = [r1 k1 d1 ;r2 k2 d2 ; r3 k3 d3]; mycell = cell(1,3); mycell{1,1} = [r1 k1 d1 ;r2 k2 d2 ; r3 k3 d3]; mycell{1,2} = ones(3); mycell{1,3} = zeroes(3); mat = cell2mat(mycell); dlmwrite('datas.txt', mat ,'precision','%.5f');
and result after importing this:
is there way make such table desire?
here's how you'd it:
x = dlmread('datas.txt'); % note data plural. datum singular! y = mat2cell(x, 3, [3 3 3])
mat2cell
reverse operation of cell2mat
given dimensions.
Comments
Post a Comment