I have a file with 19620 row and 3 columns. First columns is an index (profile number). I want to plot de data with same ID. How can I do it?
Kind Regard
example
ID Z dist
1 2 10
1 3 10
1 5 10
2 2 10
2 3 10
2 5 10
3 2 10
3 3 10
3 5 10

回答 (3 件)

Adam Danz
Adam Danz 2020 年 12 月 14 日

1 投票

Read in your data as a table named T, then follow this demo
ID = 1;
rowIdx = T.ID == ID;
plot(T.Z(rowIdx), T.dist(rowIdx))
KSSV
KSSV 2020 年 12 月 14 日

1 投票

You can plot something like this:
A = [1 2 10
1 3 10
1 5 10
2 2 10
2 3 10
2 5 10
3 2 10
3 3 10
3 5 10] ;
plot(A(A(:,1)==1,2),A(A(:,1)==1,3)) % this plot points with ID 1
You can also plot all at once using gscatter. You can put class as ID.
Joaquim Barbosa
Joaquim Barbosa 2020 年 12 月 17 日

0 投票

Thaks. It work nice.

カテゴリ

製品

リリース

R2020b

タグ

質問済み:

2020 年 12 月 14 日

回答済み:

2020 年 12 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by