0
votes

How would I go about graphing two vectors that are not the same?

An error comes up saying that they cannot be displayed and so I realize that I probably need a primary y-axis and a secondary y-axis.

How would I go about this on MatLab?

1
probably plot(1:numel(A),A,1:numel(B),B) but your question isn't very clear. What is in the vectors? Dependent or independent variables?Ben Voigt

1 Answers

0
votes

You can plot multiple vectors of different lengths on the same plot using hold on.

Example:

vec1 = [1,2,3,4,5];
vec2 = [9,10,11,12,13,14,15];

figure;
plot(vec1);
hold on;
plot(vec2);

Example Output:

enter image description here