MATLAB Answers

Plot different length vectors on the same x-axis

3 views (last 30 days)
Hi, I've got the following situation on my hands:
I have three matrixes that contain the number of epochs plus a few metrics for the training of a machine learning algorithm, for a total of 5 columns each.
The first table has 193 rows, the second and third ones have 173.
I would like to plot the second column of each matrix on the same plot, using the first column of the biggest matrix as x axis. My idea would be to obtain a plot in which the first line arrives to the limit of the x axis and the other two stop earlier.
Thank you for your attention.

  0 Comments

Sign in to comment.

Accepted Answer

Alberto Mora
Alberto Mora on 29 May 2020
So you have to do something like
plot(matix1(:,1),matix1(:,2)); hold on;
plot(matix1(1:173,1),matix2(:,2));
plot(matix1(1:173,1),matix3(:,2));

  1 Comment

Mattia Boldrini
Mattia Boldrini on 29 May 2020
well thank you, that was easier than I'd thought

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Translated by