Cell array of arrays into matrix
이전 댓글 표시
Need help!! Need to use the information here to know make figures. Trying to simply get the information to show up in a matrix rather than a cell array of cell arrays I got it down to 4X7 cell array of {1,1}
Need to try to turn this into a matrix or some kind of format I can use Tried cell2mat and it didn't work because of the cell array of arrays Any help would be appreciated ???
cd('S:\matlab\homework6\Raw_Data\lot_no_247_Data')
id_247_2014 = fopen('2014_lot_no_247_Data.txt');
id_247_2015 = fopen('2015_lot_no_247_Data.txt');
id_247_2016 = fopen('2016_lot_no_247_Data.txt');
id_247_2017 = fopen('2017_lot_no_247_Data.txt');
data_247_2014 = textscan(id_247_2014, '%s %s %s %s %s %s %s '); % Reading data_247_2015 = textscan(id_247_2015, '%s %s %s %s %s %s %s '); % Reading data_247_2016 = textscan(id_247_2016, '%s %s %s %s %s %s %s '); % Reading data_247_2017 = textscan(id_247_2017, '%s %s %s %s %s %s %s '); % Reading
for i=1:7
Categories{i}=data_247_2014{i}{1};
end
%content from year loop
for i=1:7
Content247_2014{i}=data_247_2014{i}{2};
Content247_2015{i}=data_247_2015{i}{2};
Content247_2016{i}=data_247_2016{i}{2};
Content247_2017{i}=data_247_2017{i}{2};
end
lot_247=[Content247_2014;
Content247_2015;
Content247_2016;
Content247_2017];
답변 (1개)
Hiro Yoshino
2019년 12월 26일
0 개 추천
Did you recieve an error message or get something you did not expect?
Check if
- the matrix is rectangular
- the matrix has the data in the same format
may work for you.
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!