help-octave
[Top][All Lists]
Advanced

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

Re:


From: James Sherman Jr.
Subject: Re:
Date: Thu, 26 Mar 2009 12:17:19 -0400

Are you trying to call complet from the command prompt in octave?  If so, its failing because externally, octave can only see the first function in a file.  (That is probably not a good explanation, but I think it conveys the right idea.)  If you want to call complet from the command line, you'll need to put it in a new file.

If thats not the problem you're having, are you sure you're in the right directory?  Is the file named checkp.m?  I think you're going to need to be more specific before I can try and be of any more help.

James

2009/3/25 ann sww <address@hidden>
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..

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

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