Problem with a for loop?
古いコメントを表示
Hello i want to write a for loop inside another for loop .
I drew this as an example to make it easier to understand.

My idea was to code something like this but it didnt work:
%%%%
for a = 1:200
for b = 1:7200
Calc(b,a) = (Array1(b) * Array2(b,a)) + (Array1(b-1) * Array2(b-1,a-1));
end
Table(b,a) = Calc(b,a) / constant;
end
%%%%
I would be very grateful if someone could help .
Thanks in advance.
3 件のコメント
Julian
2023 年 9 月 7 日
In your code is Calc, Table and Array of the dimension 7200x200 but in your picture 200x7200.
malik abdelli
2023 年 9 月 7 日
But now your Array1 is also a 7200x200 matrix, then you would have to initialize that differently too.
Should you "only" pay attention to the image, or also to your code?
Please write down your problem mathematically. Then you basically have the answer in Matlab.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および 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!