A=[a,b,c,d,0,0,0,0…,0] 1xN vector
Using vector "A", I want to create an NxN matrix such that each row is the previous row with its elements fliped one at a time. That is, I want to create:
[a,b,c,d,0,0,0,…,0;
0,a,b,c,d,0,0,,…0;
0,0,a,b,c,d,0,…0;
…..
0,…0,0,0,a,b,c,d]
I could use a "for statement" using A=[A(end), A(1:end-1)] and vertcat(). But is there a more efficient and elegant way of doing this? Thanks
Best Answer