フィルターのクリア

How to Recall Matrix

6 ビュー (過去 30 日間)
AR
AR 2015 年 12 月 1 日
コメント済み: Walter Roberson 2015 年 12 月 1 日
I've saved a 20,000 [3 10] sets of matrixes, called V{count}, while going through a loop of 20,000 iterations and need to recall these in order for a second loop, with a counter m.
How can I recall these in the second loop as I get the error, "Cell contents assignment to a non-cell array object" when coding the following below:
for m = 1 : 1493
X{m}=V{1:count}; % let X = V so when during loop 1 or 2 or 3 (m=1 or 2 or 3),
% the 1st then 2nd then 3rd V matrix is applied to the Y function below
Y(m)=c+X(m);
end

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 1 日
What is count?
V{1:count} creates a comma separated list of the first count entries in V, and each time through the loop you assign all count of them to X. Why are you not using
Y(m) = c + V{m};
?
But what size of output are you expecting? Each V{m} is 3 x 10, so presumably c + V{m} would be 3 x 10 as well. You are trying to store that entire matrix into a single element of Y. You would need to use
Y{m} = c + V{m};
or you would need to use
Y(:,:,m) = c + V{m};
  2 件のコメント
AR
AR 2015 年 12 月 1 日
Thanks Walter. Yes, Y(m) = c + V{m} worked. The simple, straight forward answers are often the best, as was proven in this case.
Walter Roberson
Walter Roberson 2015 年 12 月 1 日
How are you storing the entire array in Y(m) ? Is c symbolic, or is V{m} symbolic?

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

その他の回答 (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