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 comentarios

Turlough Hughes
Turlough Hughes el 25 de Dic. de 2019
Can you attach the 4 files?
Ayala Tabak-Dar
Ayala Tabak-Dar el 25 de Dic. de 2019
Sent :) Thanks in advance

Iniciar sesión para comentar.

Respuestas (1)

Hiro Yoshino
Hiro Yoshino el 26 de Dic. de 2019

0 votos

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.

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 25 de Dic. de 2019

Respondida:

el 26 de Dic. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by