[Scilab-users] New to Scilab and having issue with function I've written
tim at wescottdesign.com
tim at wescottdesign.com
Sat Jan 3 06:50:56 CET 2015
On 2015-01-02 20:47, Robin Seibel wrote:
> I wrote the following function:
>
> function [x]=isprime(num)
> vect=factor(num);
> if length(vect)==1 then
> x=1;
> else
> x=0;
> end
>
> endfunction
>
> I am getting the following output:
>
> -->isprime(25411588)
>
> 0.
> ans =
>
> 0.
>
> Why am I getting output twice, or in other words how can I suppress
> the first zero reported in the command window?
>
Hey Robin:
I just tried this, and I'm not getting that behavior. In over a decade
of using Scilab, I haven't seen that behavior. So I'm not good for much
help.
Two things that you can try, however, are:
1: If you haven't yet, try it again, in case the Evil Computer Gods have
been messing with your head. Maybe close Scilab and open it again.
2: Tell us what Scilab version you're using, as well as what OS. For
your Scilab version, type getversion (e.g. mine is Scilab-5.5.1). This
won't help me help you, but it may help someone smarter than me help
you.
More information about the users
mailing list