[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #48034] fplot not working
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #48034] fplot not working |
Date: |
Fri, 27 May 2016 00:03:43 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0 |
Update of bug #48034 (project octave):
Category: None => Octave Function
Item Group: None => Incorrect Documentation
Status: None => Confirmed
_______________________________________________________
Follow-up Comment #1:
Thanks for the report. I can confirm the error you are seeing with your given
function.
I modified it like so to make it work:
function y = fun(x)
y = zeros(size(x));
I = (x < 0) ;
y(I) = 1 ;
y(~I) = -1 ;
end
The important distinction being that the return value has the same size and
shape as the input. Your example returned a row vector regardless of whether
the input was a row, column, or matrix.
I think the error checking could be improved to make this clearer, as well as
the docstring. Suggestions?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48034>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/