how to re-assign variable within for loop

5 ビュー (過去 30 日間)
karishma koshy
karishma koshy 2019 年 8 月 17 日
編集済み: karishma koshy 2019 年 8 月 30 日
Hi
Two tables are created within a for-loop. data1 and data2 are tables that are both created within the first iteration of the i-loop. Then for second iteration i want to pass data2 of first iteration to data1 to do similar operation.
right now im getting only the last iteration value in table.
Thank you.

採用された回答

per isakson
per isakson 2019 年 8 月 18 日
A long shot. Replace
table=[data1;data2]
by
if i == 0
table = data1;
end
table = [table;data2]; %#ok<AGROW>
data1 = data2;
Comments
  • I commented out result1 = munkres(result); since munkres is missing
  • The line data2(fin1,5)=P2; throws this warning
Warning: The new variables being added to the table have fewer rows than the table. They have been extended with rows containing default
values.
> In tabular/subsasgnParens (line 364)
In tabular/subsasgn (line 61)
In cssm (line 39)
  1 件のコメント
karishma koshy
karishma koshy 2019 年 8 月 18 日
thats what i was looking for
Thank you so much for your time.

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

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