How can I merge multiple cells of data into one cell?
13 views (last 30 days)
Show older comments
Hi, I have a cell containing several cells of output data on the form:
'METAR ESDF 200807010020Z AUTO 31003KT 230V350 9999NDV NCD 12/08 Q1017'
The outer cell looks like this:
<1x6cell>
and the inner ones like this:
<1250x1cell> <1500x1celll> ...and so on
I would like to merge these inner cells to have all my data inside one cell. Is there an easy solution to this problem?
Thank you!
1 Comment
Reshad Ahmad Aria Faizy
on 21 Jan 2021
Edited: Reshad Ahmad Aria Faizy
on 21 Jan 2021
% A is your cell which contains many cell
% B , where you want to put them all
k=0;
for i=1:size(A,1)
j = size (A{i,1},1);
B (k+1:j+k,:) = A{i,1};
k = size(B,1);
end
ref:@Ali Pourzangbar
Answers (3)
Peng
on 1 Dec 2018
% transfer a nested cell array to a cell array
SEGS = {{rand(2,1);rand(3,1)};...
{rand(4,1);rand(5,1);rand(6,1)};...
{rand(7,1);rand(8,1);rand(9,1);rand(10,1)}};
A = SEGS{1};
for k = 2:size(SEGS,1)
A = [A;SEGS{k}];
end
SEGS =
{2x1 cell}
{3x1 cell}
{4x1 cell}
A =
{9x1 cell}
0 Comments
PARISA SATTAR
on 24 May 2022
Edited: PARISA SATTAR
on 24 May 2022
Data1=struct2array(load(input('enter the name of first cell:\n','s')));
Data2=struct2array(load(input('enter the name of 2nd cell:\n','s')));
l1=length(Data1);
l2=length(Data2);
l=l1+l2;
j=1
for i=1:l;
if i<=l1
R_peak_Locations_N2_CG_RBDid{i,1}=Data1{i,1}
else
R_peak_Locations_N2_CG_RBDid{i,1}=Data2{j,1}
j=j+1;
end
end
0 Comments
See Also
Categories
Find more on Large Files and Big Data 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!