From: Fernando Sobral on 3 Aug 2010 12:54 Hi, I'm working with wave and tide data and I have two vectors (one of waves data and another with tides data) that has different lenghts. Waves data starts in march 2008 and ends in march 2009, but the tides data starts on july 2008 and ends in march 2009 also. I'm trying to make a subplot 211 with the waves data and other 212 with tides, but I need that the plot starts exactly in july 2008 of waves data, more or less in the middle of window. If anyone knows how I can do that, I will be very greatfull. Thanks
From: Wayne King on 3 Aug 2010 13:19 "Fernando Sobral" <fesoceano(a)gmail.com> wrote in message <i39hjc$5lu$1(a)fred.mathworks.com>... > Hi, > > I'm working with wave and tide data and I have two vectors (one of waves data and another with tides data) that has different lenghts. Waves data starts in march 2008 and ends in march 2009, but the tides data starts on july 2008 and ends in march 2009 also. I'm trying to make a subplot 211 with the waves data and other 212 with tides, but I need that the plot starts exactly in july 2008 of waves data, more or less in the middle of window. > If anyone knows how I can do that, I will be very greatfull. > Thanks Hi Fernando, you don't have to plot the entire waves data vector. Just determine the indices that correspond to the same dates as your tides data, and just plot that subset. Alternatively, you can simply set the x-axis limits for your waves data to match those in the tides data. Wayne
From: us on 3 Aug 2010 13:43 "Fernando Sobral" <fesoceano(a)gmail.com> wrote in message <i39hjc$5lu$1(a)fred.mathworks.com>... > Hi, > > I'm working with wave and tide data and I have two vectors (one of waves data and another with tides data) that has different lenghts. Waves data starts in march 2008 and ends in march 2009, but the tides data starts on july 2008 and ends in march 2009 also. I'm trying to make a subplot 211 with the waves data and other 212 with tides, but I need that the plot starts exactly in july 2008 of waves data, more or less in the middle of window. > If anyone knows how I can do that, I will be very greatfull. > Thanks one of the many solutions line(1:10,rand(1,10),'marker','s'); set(gca,'xlim',[-10,20]); % <- set the axis's limit... line(-5:5,rand(1,11)+1,'marker','o'); us
From: Fernando Sobral on 3 Aug 2010 19:15 "us " <us(a)neurol.unizh.ch> wrote in message <i39kf9$bt9$1(a)fred.mathworks.com>... > "Fernando Sobral" <fesoceano(a)gmail.com> wrote in message <i39hjc$5lu$1(a)fred.mathworks.com>... > > Hi, > > > > I'm working with wave and tide data and I have two vectors (one of waves data and another with tides data) that has different lenghts. Waves data starts in march 2008 and ends in march 2009, but the tides data starts on july 2008 and ends in march 2009 also. I'm trying to make a subplot 211 with the waves data and other 212 with tides, but I need that the plot starts exactly in july 2008 of waves data, more or less in the middle of window. > > If anyone knows how I can do that, I will be very greatfull. > > Thanks > > one of the many solutions > > line(1:10,rand(1,10),'marker','s'); > set(gca,'xlim',[-10,20]); % <- set the axis's limit... > line(-5:5,rand(1,11)+1,'marker','o'); > > us Hi us, this really works, thank you very much! I just needed to find the position of the date in the wave data and use it how a negative value like this: xlim([-(position of the date in the wave data) length(wave data)]) very simply and really helpfull. Thanks again
From: Fernando Sobral on 4 Aug 2010 06:45 "Fernando Sobral" <fesoceano(a)gmail.com> wrote in message <i3a7ub$1i0$1(a)fred.mathworks.com>... > "us " <us(a)neurol.unizh.ch> wrote in message <i39kf9$bt9$1(a)fred.mathworks.com>... > > "Fernando Sobral" <fesoceano(a)gmail.com> wrote in message <i39hjc$5lu$1(a)fred.mathworks.com>... > > > Hi, > > > > > > I'm working with wave and tide data and I have two vectors (one of waves data and another with tides data) that has different lenghts. Waves data starts in march 2008 and ends in march 2009, but the tides data starts on july 2008 and ends in march 2009 also. I'm trying to make a subplot 211 with the waves data and other 212 with tides, but I need that the plot starts exactly in july 2008 of waves data, more or less in the middle of window. > > > If anyone knows how I can do that, I will be very greatfull. > > > Thanks > > > > one of the many solutions > > > > line(1:10,rand(1,10),'marker','s'); > > set(gca,'xlim',[-10,20]); % <- set the axis's limit... > > line(-5:5,rand(1,11)+1,'marker','o'); > > > > us > > Hi us, > this really works, thank you very much! > I just needed to find the position of the date in the wave data and use it how a negative value like this: > xlim([-(position of the date in the wave data) length(wave data)]) > very simply and really helpfull. > Thanks again Sorry, I was precipitated with my glad...... The problem is that the n sample of the tide data is much more than the wave data (even with less months), because this one get the data in each 10 min, while the wave exist in each 30 min....So if I use the xlim of wave, tide data will be incomplete, because the limit is lower than its length.....and if I use the xlim of the tide just to tide data, I don't now what is the negative point [-? length(tidedata)] that i need to use to be in the same position of July month of wave...... any idea?
|
Next
|
Last
Pages: 1 2 Prev: extract the object from original image Next: Loading a file without complete filename? |