How to convert cell to matrix
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Manuela Maria ALAMPI
el 10 de En. de 2022
Comentada: Matt J
el 11 de En. de 2022
I have a 100001x2 cell. Each cell is 1x1.
How can I convert it to matrix? I've tried cell2mat but I can't make it work
5 comentarios
Matt J
el 10 de En. de 2022
The code you've shown does not produce a 100001x2 cell array. You should attach the cell array dirctly in a.mat file so that we can avoid the steps of generating it.
Image Analyst
el 10 de En. de 2022
ca = signal.textdata([6:end],[1,2]);
save('answers.mat', 'ca');
Then attach answers.mat with the paperclip icon.
Respuesta aceptada
Jon
el 10 de En. de 2022
Side stepping the issue a little bit, I can read in your data file perfectly as numerical values and not use cell2mat at all using:
A = readmatrix('i1uss.txt','NumHeaderLines',5)
3 comentarios
Matt J
el 11 de En. de 2022
@Manuela Maria ALAMPI since it worked, you should Accept-click the post.
Más respuestas (2)
Matt J
el 10 de En. de 2022
cell2mat should have worked
A=num2cell(rand(100001,2)); whos A
B=cell2mat(A); whos B
0 comentarios
Ver también
Categorías
Más información sobre Data Type Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!