[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "table too short" error while trying to plot a function
From: |
Leo Arias F. |
Subject: |
Re: "table too short" error while trying to plot a function |
Date: |
Fri, 14 May 2010 09:27:53 -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 |
On 05/14/2010 04:09 AM, Martin Helm wrote:
> You will need to write your function in a vectorized form not in this scalar
> form, for example something like
>
> function y = functiontest1(x)
> y=zeros(size(x));
> i1 = abs(x)<1;
> i2 = 1 < abs(x) & abs(x) < 2;
> y(i1) = 1;
> y(i2) = 2-abs(x(i2));
> endfunction
>
> Then it will work.
Great, it does.
Thanks a lot.
--
¡paz y baile!
http://elopio.net