How do i plot N amount of rows into a point plot?

4 ビュー (過去 30 日間)
MBM
MBM 2022 年 1 月 16 日
編集済み: MBM 2022 年 1 月 16 日
Guys, how do you plot multiple rows into a point plot?
Here's what i've done so far:
figure(2)
F = grades(1,:);
E = 1:width(grades);
scatter(E,F)
xlabel('Assignment','FontSize',15);ylabel('Grade','FontSize',15);
yticklabels({'-3','00','02','4','7','10','12'});
title ('Grades per assignment','FontSize',20);
In this code i only plot row 1 but what if i need to plot N Rows? I need to write a code where the input argument is an NxM Matrix.

採用された回答

Max Heimann
Max Heimann 2022 年 1 月 16 日
Whats the content of your variable "grades"?
You can plot multiple lines one after the other with the hold command. (A,B,C,D,E,F are your data vectors)
figure('Name','Example Plot')
scatter(A,B)
hold on
scatter(C,D)
scatter(E,F)
...
You could simply loop over your matrix and plot each line like this.
  5 件のコメント
Max Heimann
Max Heimann 2022 年 1 月 16 日
I did account for that by adding
(1 - 2 * rand) * 0.1
To the data on each cycle. This should be a random number between -.1 and .1. Did this not work?
MBM
MBM 2022 年 1 月 16 日
It worked! Thanks!!! :D

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by