help-octave
[Top][All Lists]
Advanced

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

Re: I couldnt run function, I got error


From: Doug Stewart
Subject: Re: I couldnt run function, I got error
Date: Wed, 7 Feb 2018 09:57:39 -0500



On Wed, Feb 7, 2018 at 9:34 AM, Doug Stewart <address@hidden> wrote:


On Wed, Feb 7, 2018 at 3:19 AM, Aziz YÜCELEN <address@hidden> wrote:

Hi

I am new for octave software. I wrote a function in a file (file name is try3.m ) and ran 


#  try3.m file

function find_point(x, modulo)
xeq1=(x^3)+x+1;
xeq2 = mod(xeq1,modulo);
  for i=0:(modulo-1)
      yeq1=(i^2);
     yeq2=mod(yeq1,modulo);
         if (xeq2==yeq2)
            printf("results:x= %d icin y=%d \n",x,i);
        endif
   endfor
endfunction
but I got this result:

>> try3

error: 'x' undefined near line 4 column 7
error: called from
    try3.m at line 4 column 5


what is wrong? And I want to call this function from cli but how?


Thanks.


-----------------


from the cli try this

find_point(7,3)

--
DAS

I should have said:
try3(7,3)



--
DASCertificate for 206392


reply via email to

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