Info

This question is closed. Reopen it to edit or answer.

From for loop, how save results as a diagonal matrix

1 view (last 30 days)
bashar halleem
bashar halleem on 20 May 2020
Closed: Stephen23 on 20 May 2020
For loop, every time results 24 * 3 elements, next loop another 24 *3 elements. I want save all the results elements of the complete loop as a diagonal matrix upper and lower are zeros. How can I do that
  2 Comments
Walter Roberson
Walter Roberson on 20 May 2020
24*3 is more than 12 full columns of a diagonal matrix and less than 13.
1 2 4 7
3 5 8
6 9
10
and so on. Now when you start filling in the second such matrix for the second iteration of the loop should it continue from where the previous one left off in mid column, or should it start at the top of the next column?
A diagram of what you want would help.

Answers (0)

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!