[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"table too short" error while trying to plot a function
From: |
Leo Arias F. |
Subject: |
"table too short" error while trying to plot a function |
Date: |
Thu, 13 May 2010 18:21:31 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4 |
Hello,
I'm new with this. I'm just learning with the matlab guide.
I followed the guide in [1] and could plot the humps funtion without
problems.
But I defined my own function on the functiontest1.m file:
function y = functiontest1(x)
if abs(x)<1
y = 1;
elseif 1 < abs(x) && abs(x) < 2
y = 2 - abs(x);
else
y = 0;
end
And when I try to plot it:
octave3.2:1> fplot(@functiontest1, [-3 3])
I get the following error:
error: interp1: table too short
error: called from:
error: /usr/share/octave/3.2.3/m/general/interp1.m at line 143, column 5
error: /usr/share/octave/3.2.3/m/plot/fplot.m at line 86, column 11
Could you please tell me what I'm doing wrong?
thanks :)
pura vida
[1]
http://www.mathworks.com/access/helpdesk/help/techdoc/math/bsgprpq-4.html
--
¡paz y baile!
http://elopio.net
- "table too short" error while trying to plot a function,
Leo Arias F. <=