Hello.
I have two 2D metrices of different size
a = 2 x 375
b = 2 x 500
All data is between -0.5 to +0.5 in both X & Y Axis.
How to plot these data on the same Y vs X plot ? AND
How to plot these data against the number of iterations (normalized from 0) on the same plot?

2 件のコメント

KSSV
KSSV 2020 年 9 月 17 日
As the data has same limit -0.5 to +0.5 you shall get the same Y-axis..why worried? Can't you use plot?
Vaibhav Gupta
Vaibhav Gupta 2020 年 9 月 17 日
I tried but it didn't work. So my data looks like below. I am new to matlab, so i tried using plot (metrics1, metric2) and it was weired.

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

 採用された回答

KSSV
KSSV 2020 年 9 月 17 日

1 投票

Two options:
% If each matrix has two curves
figure
plot(A')
hold on
plot(B')
% If each matrix has (x,y) coordinates
figure
plot(A(1,:),A(2,:))
plot(B(1,:),B(2,:))
If not this you are expecting. Share your data.

6 件のコメント

Vaibhav Gupta
Vaibhav Gupta 2020 年 9 月 17 日
Thanks Bro...that worked for first part!
How to do second part - plot these data against the number of iterations (normalized from 0) on the same plot?
KSSV
KSSV 2020 年 9 月 17 日
That depends on how your code is. Two options.
  1. USe hold on and plot inside the loop.
  2. Save the entire data into a matrix and plot after the loop.
Vaibhav Gupta
Vaibhav Gupta 2020 年 9 月 17 日
Thank you! That worked.
KSSV
KSSV 2020 年 9 月 17 日
Thats good...Thank you accepting/voting answer. :)
Vaibhav Gupta
Vaibhav Gupta 2020 年 9 月 17 日
By the way....current plot i am getting like this where axis are at bottom.
Is it possible to have something like below showing in 4 quadrants?
KSSV
KSSV 2020 年 9 月 17 日

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

その他の回答 (0 件)

カテゴリ

質問済み:

2020 年 9 月 17 日

コメント済み:

2020 年 9 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by