insert ones at given position of matrix
11 次查看(过去 30 天)
显示 更早的评论
I'm stuck on this probably very simple thing - I have this matrix:
rd = zeros(4, 6);
and x is meant to be the position I would like to insert a 1:
x = [3 1 3 1 1 1];
to obtain this:
0 1 0 1 1 1;
0 0 0 0 0 0;
1 0 1 0 0 0;
0 0 0 0 0 0;
Would anybody please be able to help?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!