필터 지우기
필터 지우기

cell to a matrix

조회 수: 3 (최근 30일)
jenifer Ask
jenifer Ask 2019년 12월 30일
답변: Bhaskar R 2019년 12월 30일
I want to convert the cell to a matrix . But it gives error. Why?
A=cell2mat(FV1);

채택된 답변

Bhaskar R
Bhaskar R 2019년 12월 30일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by