|
Srikanth <skt@xdtech.com> wrote in message <2873f72e-6344-46e2-af6d-7fde55641c78@k29g2000prf.googlegroups.com>...
> On Mar 12, 10:27=A0am, "Faraz Afzal" <farazaf...@gmail.com> wrote:
> > Hello everyone,
> >
> > I wanted to have 2000 discrete steps of time 0 to18 seconds done by using=
> linspace(0,18,2000).
> >
> > Now I need a step input such that it uses the time vector above and must =
> generate step when time is 10 seconds ..This step input infact is a negativ=
> e 2 (i.e. -2 step)..
> >
> > so from time 0 to 10 seconds =A0=3D =A00
> > =A0 =A0 =A0 =A0 =A0 time 10 to 18 seconds =A0=3D -2
> > .I can do it in simulink but i have to work on a data in my workspace.
>
> Several ways - from simulink, you can output the data to workspace
> using a To Workspace sink.
>
> Alternatively, you could generate the plot as
> y=3Dlinspace(0,18,2000);
> y(y<10)=3D0;
> y(y>10)=3D-2;
> (Or just concatenate two linspaces, but you'll have to compute the
> number of points by taking the ratio of 10 and 18, which might not
> divide your total number of
>
> > I hope I explained my problem...
> > Secondly i want to plot this step input and its response on a same plot..=
> .what should i do. I dont want subplots anywayz..
> > =A0Good day!!
>
> look for hold on or
> try plot(1:2000,input,1:2000,output)
>
> hth
unfortunately it does not helps, or may b i dont know how should i handle this.
When i use sink, to workspace, with a step that starts at 10 seconds with value -2 i get two variable in workspace called tout and simout.
now when i plot them i never see a step as i can see them in simulink scope. it just shows me a linear line thats it.. for tout ...
Am i doing right or still missing sumthing.???how should i now plot them from workspace.??
Hope i get solution.!!
|