How to iterate diagonal with alternating values?
2 views (last 30 days)
Hi everyone! I have a question about iterating diagonally across a matrix I create. Here is the code I have so far. I am a beginner at Matlab, so I am trying to do this with a for loop, but getting stuck! If anyone can please help me do this it would be greatly appreciated! I am trying to get the values in green to be set to the value of e_p, thank you so much !!!
HM = zeros(n);
HM(ii,ii) = e;