How to create a Nx3 array from Nx4 array
1 次查看(过去 30 天)
显示 更早的评论
Hi all,
If I have a 100x1 cell array which contains 100 Nx4 double array where N is a variable size, how to I create a new cell array which is also 100x1, but contains a Nx3 double array that contains just columns 2,3 and 4 of the previous Nx4 array?
Hope that make sense! I'd appreciate any help with this problem.
Thanks in advance!
0 个评论
采纳的回答
Ameer Hamza
2020-11-27
You can use cellfun()
C1; % 100x1 with Nx4 matrices
C2 = cellfun(@(x) {x(:,2:end)}, C1);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!