Performing operations using variables created by For Loop outputs
2 ビュー (過去 30 日間)
古いコメントを表示
Using a previous For Loop, I have created 704 3x3 matrices defined as N1uik, N2uik, N3uik...N704uik. (All values contained are real numbers)
I now want to use elements of these matrices as part of another For Loop, to create various other matrices named x1,x2,x3...x704.
I have tried:
For n=13:692
x(1,1)=((N(n-11)uik(1,3))-(N(n+11)uik(1,3)))/2;
x(1,2)=((N(n-1)uik(1,3))-(N(n+1)uik(1,3)))/3;
x(1,3)=0
eval(sprintf('x%d=x',n));
end
Obviously recalling values from the previously defined variables in this "N(n+1)uik" way does not work. How can this be done?
Thanks
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 3 月 9 日
編集済み: Azzi Abdelmalek
2013 年 3 月 9 日
This is incorrect expression
N(n-11)uik(1,3)
Why have you created all those variables, while you could use one array 704x3x3?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!