relationship between 2 matrix
1 次查看(过去 30 天)
显示 更早的评论
A, B is matrix:
A=[1;2;3;4;5;6;7;8;9];
B=[2;4;7;9];
How to find matrix C as follow?
C=[1;[];3;[];5;6;[];8;[]];%the location of matrix B from A will be replaced by [] value
0 个评论
采纳的回答
更多回答(1 个)
Matt J
2018-4-13
If you mean that [] actually must reside in those spots, it can only be done with a cell array
C=num2cell(A);
C(B)={[]}
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!