282 Chapter 6. Function Reference
This function diļ¬ers from the interpolate function in that it can handle zero order
hold type interpolation and deal with irregularly spaced input pdms. Irregularly spaced
output pdms can be generated with the domspec syntax. These features are oftenuseful
when dealing with data generated from experiments.
Example
time = [0:1:5]
u = gstep(time,time,time)
u1 = interp(u,0.25,{order=0})
time2 = sort(5*random(20,1))
u2 = interp(u,time2,{order=1})
gph1 = ctrlplot(u2,{marker=1,marker style=1,...
marker size=1,line=0}); gph1 =
plot(u1,gph1,{marker=1,marker style=6,...
marker size=1,line=0}); gph1 =
plot(u,gph1,{marker=1,marker style=9,...
marker size=1,line=0}); gph1 = plot(gph1,{legend=["1st
order interp.";...
"0 order interp.";"original pdm"]})?