From: Maria on
Hi

I have a matrix Xt with H rows and 1 col , which every row is a function of t (time) . I wanted to ezplot these rows according to t domain:

this is what i want:


Xt=ff*yt
ezplot(Xt,(0:1))
hold on


but this function just plot the final row. How can I do to plot all rows in one plot area???

Tanx
From: Wayne King on
"Maria " <mr79va(a)gmail.com> wrote in message <hqbm0d$jt6$1(a)fred.mathworks.com>...
> Hi
>
> I have a matrix Xt with H rows and 1 col , which every row is a function of t (time) . I wanted to ezplot these rows according to t domain:
>
> this is what i want:
>
>
> Xt=ff*yt
> ezplot(Xt,(0:1))
> hold on
>
>
> but this function just plot the final row. How can I do to plot all rows in one plot area???
>
> Tanx

Hi Maria, ezplot only accepts function handles and string arguments as inputs. For example,

ezplot('x^2',[-2,2])

So if your input is really a matrix, I'm surprised you don't just get an error. What does

class(Xt)

return?
If you have a matrix, you can just use plot() and create a time vector for the interval [0,1]. Although, something seems a bit strange. If you have a matrix with H rows and 1 column, then you just have a column vector. If you really want to plot the rows as you suggest in your post, then you will only have a single value per row.

Assume you have a matrix of data X with 3 rows of data sampled at 10 Hz over [0,1]

X = randn(3,10);
t = 0:0.1:1-0.1;
plot(t,X');

Wayne