Borrar filtros
Borrar filtros

cell to a matrix

1 visualización (últimos 30 días)
jenifer Ask
jenifer Ask el 30 de Dic. de 2019
Respondida: Bhaskar R el 30 de Dic. de 2019
I want to convert the cell to a matrix . But it gives error. Why?
A=cell2mat(FV1);

Respuesta aceptada

Bhaskar R
Bhaskar R el 30 de Dic. de 2019
Your FV1 matrix has empty cells this leads to dimension concatenate consistent error so you need to replace those empty cells with nan/0/mean(your requirement) then you can convert to matrix
FV1(cellfun(@isempty, FV1)) = {nan}; % i took nan for empty cell
A=cell2mat(FV1); % this works now

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by