Azzera filtri
Azzera filtri

Unable to plot 2 columns of a matrix against each other

2 visualizzazioni (ultimi 30 giorni)
Hello, I have a 466x2 matrix and I am trying to plot column 1 on the x-axis and column 2 on y. For that, I am trying the following:
I have the matrix antenna1 as
Column 1 Column 2
0.047393 2530
0.047393 2529
0.097389 2513
0.097389 2491
0.147392 2462
0.147392 2423
0.19739 2387
0.19739 2353
0.247396 2328
0.247396 2310 .... and so on
I am plotting the graph using:
figure
hold on
plot(antenna1(:,1),antenna1(:,2))
I get the following graph for this:
This graph shows both lines plotted on the y-axis. I want column 1 on x and column 2 on y.
How do I achieve this?
Thanks for any help.
Pranav

Risposta accettata

KSSV
KSSV il 6 Dic 2016
Try
n = 1 ; % play around with n
plot(antenna1(1:end-n,1),antenna1(1:end-n,2))

Più risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by