help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: ann sww
Date: Wed, 25 Mar 2009 19:47:38 -0700 (PDT)

i try to write  twi function and one is calling the other
 
function [myprime]=checkp(value)
value=input('inter a value');
 
  myprime=complet(value) 
   check=complet.*1;
  if check==1
   disp('true prime');
    else
    disp('false prime');
    end 
 
 
 
function myprime=complet()
value=input('value');
complet=1;
number=2;
myprime=complet;
  while complet==1  & number<value
   
  divesion=value/number;
 
    round_divesion=round(divesion);
   
    differance=(divesion-round_divesion);
   
     if differance ~= 0
       complet=1;
       else
       complet=0;
     end  
   
   number=number+1;    
   
 end
 
// the name of the function is always undefined
 


Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now..
reply via email to

[Prev in Thread] Current Thread [Next in Thread]