How to cover a cell array to mat?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Chuanjung Lin
el 29 de En. de 2018
Respondida: Arun Mathamkode
el 1 de Feb. de 2018
Hi all, I have a 1x6 cell array {Vg} that contain different array size as the attached.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169572/image.png)
I would to cover it to mat, and I use the statement "cell2mat", it always show Error using CAT as the attached.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169574/image.png)
Have any methods to solve this problem? Thank you.
Vg={};
for i=0:2:10
y=Rawdata(:,2+i);
y_data=find(y>0.93e-9 & y<1.9e-9);
Vg=[Vg x(y_data)];
end
Vg_data=cell2mat(Vg);
0 comentarios
Respuesta aceptada
Arun Mathamkode
el 1 de Feb. de 2018
As the error says the dimensions of each element of the cell array you are trying concatenate into a matrix are not consistent. Please refer to the documentation of the cell2mat function. It says ' the contents of cells in the same column must have the same number of columns, although they need not have the same number of rows'. In your case, the elements in the first column of the cell array have different number of columns.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!