필터 지우기
필터 지우기

how to transfer elements in cell into matrix in MATLAB?

조회 수: 1 (최근 30일)
siddhesh rane
siddhesh rane 2013년 5월 22일
I am trying to transfer elements in (1*1) cell which has one column matrix into another column matrix using while loop..and I am getting "Subscripted assignment dimension mismatch." error..can anyone please explain whats the problem..or any other way to do the same thing?
  댓글 수: 1
siddhesh rane
siddhesh rane 2013년 5월 22일
I m trying to use following code-
P(1,1) = C{1,1}{11,1};
Which I think should transfer C{1,1}{11,1} into matrix P's first row and first column..but its showing "Subscripted assignment dimension mismatch." error.

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

채택된 답변

David Sanchez
David Sanchez 2013년 5월 22일
A=ones(3,1);
C=cell(1);
C{1} = A; %matrix to cell
B = cell2mat(C)
>>B =
1
1
1
  댓글 수: 2
siddhesh rane
siddhesh rane 2013년 5월 22일
Can you please explain whats wrong with this-->>
P(1,1) = C{1,1}{11,1};
Which I think should transfer C{1,1}{11,1} into matrix P's first row and first column..but its showing "Subscripted assignment dimension mismatch." error.
siddhesh rane
siddhesh rane 2013년 5월 22일
Actually i have some text data in my cell..and i think i have to use loop to transfer only numerical data in matrix..

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by