help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with interp script on page 324 of Octave3.0.1 manual


From: Prof M. N. Anandaram
Subject: Problem with interp script on page 324 of Octave3.0.1 manual
Date: Fri, 15 Aug 2008 19:45:36 -0700 (PDT)

Hello jwe or anyone:
The program and the response are given below. 
Help with modification will be appreciated.
Anandaram
=======================================================
% this script is from Ch.28, page 324 of GNUOctave manual:
t = -2:2;
dt = 1;
ti =-2:0.025:2;
dti = 0.025;
y = sign(t);
ys = interp1(t,y,ti,'spline');
yp = interp1(t,y,ti,'pchip');
ddys = diff(diff(ys)./dti)./dti;
ddyp = diff(diff(yp)./dti)./dti;
figure(2);
plot (ti, ys,'r-', ti, yp,'g-');
legend('spline','pchip',4);
figure(2);
plot (ti, ddys,'r+', ti, ddyp,'g*');
legend('spline','pchip');

%-----------------------------------------------------------------
Octave 3.0.1 responds with this error message:
error: __plt2vv__: vector lengths must match
error: evaluating if command near line 59, column 3
error: called from `__plt2vv__' in file 
`H:\Octave\share\octave\3.0.1\m\plot\__plt2vv__.m'
error: evaluating assignment expression near line 63, column 14
error: evaluating if command near line 60, column 5
error: evaluating if command near line 51, column 3
error: called from `__plt2__' in file 
`H:\Octave\share\octave\3.0.1\m\plot\__plt2__.m'
error: evaluating assignment expression near line 76, column 10
error: evaluating if command near line 75, column 4
error: evaluating if command near line 55, column 2
error: evaluating if command near line 54, column 7
error: evaluating while command near line 41, column 5
error: evaluating if command near line 28, column 3
error: called from `__plt__' in file 
`H:\Octave\share\octave\3.0.1\m\plot\__plt__.m'
error: evaluating assignment expression near line 187, column 9
error: called from `plot' in file `H:\Octave\share\octave\3.0.1\m\plot\plot.m'
error: near line 16 of file `intpol2.m'
>Exit code: 1


      


reply via email to

[Prev in Thread] Current Thread [Next in Thread]