a simple vector to a matrix
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I am trying to write a code that convert a vector like the following for example:
X=[1 2 3];
to a matrix like the following:
Z=[1 0 0 2 0 0 3 0 0;...
0 1 0 0 2 0 0 3 0;...
0 0 1 0 0 2 0 0 3];
Any ideas?
Thanks very much.
0 个评论
回答(2 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!