Replace Element of an Array with another Array
1 次查看(过去 30 天)
显示 更早的评论
Hello, I have an initiator matrix
In=[1 0 1;0 0 0;1 0 1]; % Initiator Matrix
and a zero matrix
zero=zeros(3);
- Step 1I need to find all elements in "In" that are equal to 1 and insert "In" in that elements place, all elements with "0" insert the matrix "zero" in that place. This is a cellarray.
- Step 2I need to convert to the cellarray to a matrix. I think I do that with cell2mat() command right?
Thanks for your help.
Russell
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!