Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
dpb
Posts:
6,677
Registered:
6/7/07
|
|
Re: Single Trendline for multiple datasets
Posted:
Jan 23, 2013 4:18 PM
|
|
On 1/23/2013 3:03 PM, Charlotte wrote: > TideMan <mulgor@gmail.com> wrote in message > <5ee51095-fef4-4353-8f44-4474a719180f@googlegroups.com>... >> On Thursday, January 24, 2013 9:24:08 AM UTC+13, Charlotte wrote: >> > I have a plot with multiple datasets plotted, and would like to plot >> on top a single trendline for all the datasets - is there an easy way >> to do this? >> >> 1. Assemble all the data into two vectors, x and y >> x=[x1(:);x2(:); etc ]; ...
> > thank you very much for your reply - I get an error on the coef line: > ??? Error using ==> horzcat > CAT arguments dimensions are not consistent. > ...
> so my y vector will be something like [332.456 345.321 234.543 453.456, > etc.] > and my x will be [1 2 1 2, etc.] > > any help much appreciated!
Looks like you didn't use column vectors...if you have row vectors, transpose them and concatenate vertically as Tideman's example...then the dimensions/orientation should be fine.
If that doesn't do it, post specifics of what you did and your data sizes/shapes.
--
|
|
|
|