フィルターのクリア

Using .data{1,i} in a for loop

5 ビュー (過去 30 日間)
bugatti79
bugatti79 2013 年 10 月 18 日
コメント済み: bugatti79 2013 年 10 月 18 日
Hi Folks,
I have a 1*12 cell array which contains twelve 1*1 struct arrays. Each of which subsequently contains a matrix and it is in the form
Test{1,i}.data
I am struggling to implement the above line in a for loop. Here it is
for i=1:5
Work(i)=Constant.*Test{1,i}.data.*Increment;
end
I get error stating "In an assignment A(I) = B, the number of elements in B and I must be the same." Any ideas?
Thanks in advance B
  1 件のコメント
ES
ES 2013 年 10 月 18 日
編集済み: ES 2013 年 10 月 18 日
What is 'Work'?

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 18 日
Use Work{i} instead of Work(i)

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2013 年 10 月 18 日
for ii = 1:5, Work{ii}=Constant.*Test{1,ii}.data.*Increment; end
  1 件のコメント
bugatti79
bugatti79 2013 年 10 月 18 日
Thank you both guys

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

カテゴリ

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