Navigation

Operators and Keywords

Function List:

C++ API

interpimages.m File Reference


Functions

function interpimages (nm, typ) bury_output()
 if (strcmp(typ,"png")) set(0
*endif if (strcmp(typ,"txt")) image_as_txt(nm)
 plot (ti, yp, 'g', ti, interp1(t, y, ti, 'spline'), 'b',...ti, interpft(y, k), 'c', t, y, 'r+')
 legend ('sin(4t+0.3) cos(3t-0.1)','spline','interpft','data')
 print (cstrcat(nm,".", typ), cstrcat("-d", typ)) elseif(strcmp(nm
 mesh (zi, yi, squeeze(vi(1,:,:)))
 plot (ti, ys,'r-', ti, yp,'g-')
 legend ('spline','pchip', 4)
 plot (ti(2:end-1), ddys,'r *', ti(2:end-1), ddyp,'g+')
 legend ('spline','pchip')
endfunction function bury_output () f
 set (f,"visible","off")
endfunction function image_as_txt (nm) fid
 fputs (fid,"\n")
 fputs (fid,"+---------------------------------+\n")
 fputs (fid,"| Image unavailable in text mode. |\n")
 fclose (fid)

Variables

 defaulttextfontname
elseif(strcmp(nm,"interpft")) t=0 dt = t(2)-t(1)
 n = length (t)
 k = 100
 ti = t(1) + [0 : k-1]*dt*n/k
 y = sin (4*t + 0.3) .* cos (3*t - 0.1)
 yp = sin (4*ti + 0.3) .* cos (3*ti - 0.1)
interpn x = y = z = -1:1
 f = @(x,y,z) x.^2 - y - z.^2
 v = meshgrid (x, y, z) f (xx,yy,zz)
 xi = yi = zi = -1:0.1:1
 vi = ndgrid (xi, yi, zi) interpn(x, y, z, v, xxi, yyi, zzi, 'spline')
interpderiv1 t = -2:2
 dti = 0.025
 ys = interp1(t,y,ti,'spline')
 ddys = diff(diff(interp1(t,y,ti,'spline'))./dti)./dti
 ddyp = diff(diff(interp1(t,y,ti,'pchip'))./dti)./dti

Function Documentation

endfunction function bury_output (  ) 

fclose ( fid   ) 

fputs ( fid  ,
"| Image unavailable in text mode. |\n"   
)

fputs ( fid  ,
"+---------------------------------+\n"   
)

fputs ( fid  ,
"\n"   
)

* endif if ( strcmp(typ,"txt")   ) 

Type Constraints

if ( strcmp(typ,"png")   ) 

endfunction function image_as_txt ( nm   ) 

function interpimages ( nm  ,
typ   
)

legend ( 'spline ,
'pchip'   
)

legend ( 'spline ,
'pchip'  ,
 
)

legend ( 'sin(4t+0.3) cos(3t-0.1)'  ,
'spline ,
'interpft'  ,
'data  
)

mesh ( zi  ,
yi  ,
squeeze(vi(1,:,:))   
)

plot ( ti(2:end-1)  ,
ddys  ,
'r *'  ,
ti(2:end-1)  ,
ddyp  ,
'g+'   
)

plot ( ti  ,
ys  ,
'r-'  ,
ti  ,
yp  ,
'g-'   
)

plot ( ti  ,
yp  ,
'g'  ,
ti  ,
interp1(t, y, ti, 'spline')  ,
'b'  ,
  ti,
interpft(y, k ,
'c'  ,
,
,
'r+'   
)

print ( cstrcat(nm,".", typ ,
cstrcat("-d", typ)   
)

set ( ,
"visible"  ,
"off"   
)


Variable Documentation

ddyp = diff(diff(interp1(t,y,ti,'pchip'))./dti)./dti

ddys = diff(diff(interp1(t,y,ti,'spline'))./dti)./dti

dt = t(2)-t(1)

dti = 0.025

test f = @(x,y,z) x.^2 - y - z.^2

k = 100

test n = length (t)

else t = -2:2

ti = t(1) + [0 : k-1]*dt*n/k

v = meshgrid (x, y, z) f (xx,yy,zz)

endfor vi = ndgrid (xi, yi, zi) interpn(x, y, z, v, xxi, yyi, zzi, 'spline')

interpn x = y = z = -1:1

endif endfunction shared xi = yi = zi = -1:0.1:1

y = sin (4*t + 0.3) .* cos (3*t - 0.1)

yp = sin (4*ti + 0.3) .* cos (3*ti - 0.1)

ys = interp1(t,y,ti,'spline')