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];

2 Comments

Can you attach the 4 files?
Sent :) Thanks in advance

Sign in to comment.

Answers (1)

Hiro Yoshino
Hiro Yoshino on 26 Dec 2019
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.

Products

Asked:

on 25 Dec 2019

Answered:

on 26 Dec 2019

Community Treasure Hunt

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

Start Hunting!