How to create a plot for an array?

So lets say that I have an array of GPAs and Student IDs.
Info = [52211 3.55; 52922 1.79; 51939 3.33; 12140 0.81]
How can I plot the GPAs based on the their rank? So the GPA 3.55 is #1, 3.33 is #2, 1.79 is #3, and 0.81 is #4.

2 件のコメント

Bob Thompson
Bob Thompson 2018 年 10 月 15 日
What kind of plot do you want? Scatter, line, bar, pie? Do you just want to have them against their rank? Labeled by their SID?
PJ
PJ 2018 年 10 月 15 日
編集済み: PJ 2018 年 10 月 15 日
Scatter and just against their rank. The SID is essentially irrelevant.

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

回答 (1 件)

Bob Thompson
Bob Thompson 2018 年 10 月 15 日

0 投票

Infos = sortrows(Info,2);
Infos = flip(Infos,1);
Infos(:,3) = [1:size(Infos,1)]';
scatter(Infos(:,3),Infos(:,2));

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

質問済み:

PJ
2018 年 10 月 15 日

回答済み:

2018 年 10 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by