Info

This question is closed. Reopen it to edit or answer.

Plotting in graph from two different matrix where they have one common parameter.

1 view (last 30 days)
Say, I have two tables. One Has two columns with the value of x and y. Another is y and z. Now how can I plot x vs z using these two different datasets?

Answers (1)

Ameer Hamza
Ameer Hamza on 20 Apr 2018

Are you dealing with Matrices or tables? Both are the name of different classes in MATLAB. Either way, if both matrices (say A and B) have the same number of rows, you can simply use

plot(A(:,1), B(:,2));

This will plot 1st column of A against the second column of B.

Tags

Community Treasure Hunt

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

Start Hunting!