[Scilab-users] New to Scilab and having issue with function I've written

Robin Seibel frequencyspace at gmail.com
Sat Jan 3 05:47:54 CET 2015


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?

Thanks,

Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150102/bc3deb92/attachment.htm>


More information about the users mailing list