Need help to make a for loop

9 次查看(过去 30 天)
Ibrahim Mahmood Shah
评论: Stephen23 2017-3-6
I got a K (5x5) matrix all zeros K1 (3x3) is associated with 1,2,3 K2 (3x3) is associated with 3,4,5
I Need to add K1 and K2 in a for loop to make a 5x5 matrix
  4 个评论
Stephen23
Stephen23 2017-3-6
Read these:
And this quote from the MATLAB documentation: "A frequent use of the eval function is to create sets of variables such as A1, A2, ..., An, but this approach does not use the array processing power of MATLAB and is not recommended"
Then use indexing instead of dynamic variable names: indexing is simple, fast, efficient, and much less buggy.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by