variable with respect to i and j and k ?

1 回表示 (過去 30 日間)
Mary Jon
Mary Jon 2013 年 11 月 28 日
回答済み: Walter Roberson 2013 年 11 月 29 日
If Iam have variable A with respect to i and j,the loop include this variable is,
for i=1:10
for j=1:10
A(i,j)=statment
end
end
NOW, if I am want to applied other for loop (k=1:20) as example ,after ended i and j loop,start loop k on this variable and repeted the i,j loop again How can defined A with respect the three loop

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 11 月 29 日
for k = 1 : 20
for i = 1 : 10
for j = 1 : 10
A(i,j) = statement;
end
end
end
But perhaps you will prefer
A(i,j,k) = statement;

カテゴリ

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