Subscripted assignment dimension mismatch.

4 ビュー (過去 30 日間)
merialu
merialu 2018 年 11 月 9 日
コメント済み: madhan ravi 2018 年 11 月 9 日
Hi, I have an cell array of 6031x1 cell. each cell contain as matrix of different number of rows but with 53 columns.
i try to create a new matrix containing the number of transitions in each column in each cell of the cell array.
I have used this code:
for i=1:6031
newmatrix(i,:)=sum(diff(mycellarray{i})~=0);
end
but i get the error message: Subscripted assignment dimension mismatch. when i tried to rn it yesterday i also got the error message: Assignment has more non-singleton rhs dimensions than non-singleton subscripts.
Anybody who has any idea of what i am doing wrong?

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 9 日
編集済み: madhan ravi 2018 年 11 月 9 日
newmatrix=cell(1,6031); %before loop
newmatrix{i} %inside loop
celldisp(newmatrix) %after loop
  2 件のコメント
merialu
merialu 2018 年 11 月 9 日
Thank you! works perfect.
madhan ravi
madhan ravi 2018 年 11 月 9 日
Anytime :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by