필터 지우기
필터 지우기

Understanding "Cell contents reference from a non-cell array object." error

조회 수: 6 (최근 30일)
Khairul Nur
Khairul Nur 2019년 11월 18일
댓글: James Tursa 2019년 11월 18일
i try to convert table mnew to array. Below is my code. Please help me to understand. I also tried tabletoarray(has error too) n tabletocell not suitable to my needs.
for iii = 1 : k %k=4
for jj = 1 : noofcol-1 %11-1
val2 = mnew{iii,jj};
if (ischar(val2))
val2 = str2double(val2);
end
M_M(iii,jj) = val2;
end
end
MMM = reshape(M_M,k,noofcol-1)
however there is an error
"Cell contents reference from a non-cell array object.
val2 = mnew{iii,jj};
  댓글 수: 3
Khairul Nur
Khairul Nur 2019년 11월 18일
mnew is table 4x11
14 25 14 11 11 13 12 12 12 13 'DE0-29351'
13 24 14 10 11 14 12 13 12 14 'C1-121286'
14 25 15 11 11 14 12 12 10 14 'AG0-7CGUV'
13 25 14 11 12 14 12 12 13 13 'B0-21946'
James Tursa
James Tursa 2019년 11월 18일
So. the curly braces { } are for use with indexing into cell arrays, and mnew is not a cell array, hence the error.

댓글을 달려면 로그인하십시오.

답변 (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