0
votes

I have three variables:

First variable is: time (datenum), Second variable is: depth, Third variable is: u (x component of velocity)

I need to plot the u with x axis as time, u data should be starting from that depth.

I tried to use this:

x1 = time;
y1 = depth(:,1);
y2 = u(:,1);

plotyy(x1,y2,x1,y1);

But i dont want to plot depth but instead i want the u data to start from that depth value, but depth value should be shown on second y axis. Since i will be changing the depth matrix again and plotting on same plot. Note that depth matrix is just one depth (1.20) through out.

1

1 Answers

0
votes

If I understand what you're saying here, you're looking to plot time alog the X axis and depth along the Y axis (which you already have).

But the caveat is that you want to start te Y axis from a certain depth that you have in the variable 'u'.

To do this you might want to look into the axis command in matlab:

This will allows you to set Xmin, Xmax, Ymin and Ymax and scale the plot how you like.