Extracting only certain data from a matrix
显示 更早的评论
I have a very large matrix and I need only certain data to show from it. I need only the data that has values of 3 in the first column. How do I find this.
1 个评论
the cyclist
2023-7-11
回答(2 个)
Stephen23
2023-7-11
Where M is your matrix:
X = M(:,1)==3;
B = M(X,:)
Parth Saraf
2023-7-11
Hi,
You can try using this:
M(M(:, 1) == 3)
Hope this helps!
1 个评论
the cyclist
2023-7-11
I think this needs to be
M(M(:, 1) == 3,:)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!