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
the cyclist 2023 年 7 月 11 日
You might benefit from the free MATLAB Onramp tutorial.

サインインしてコメントする。

回答 (2 件)

Stephen23
Stephen23 2023 年 7 月 11 日

0 投票

Where M is your matrix:
X = M(:,1)==3;
B = M(X,:)
Parth Saraf
Parth Saraf 2023 年 7 月 11 日

0 投票

Hi,
You can try using this:
M(M(:, 1) == 3)
Hope this helps!

1 件のコメント

the cyclist
the cyclist 2023 年 7 月 11 日
I think this needs to be
M(M(:, 1) == 3,:)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

タグ

質問済み:

2023 年 7 月 11 日

コメント済み:

2023 年 7 月 11 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by