help-octave
[Top][All Lists]
Advanced

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

Re: Constant errors although the program is correct


From: Doug Stewart
Subject: Re: Constant errors although the program is correct
Date: Sat, 2 Dec 2017 12:25:31 -0500



On Fri, Dec 1, 2017 at 10:01 PM, monteirojp <address@hidden> wrote:
hi, i wrote this script: function y = func(x0)
                                y = 49890/10000 + sin(x0) - x0.^2
                                end
it's a simple script but when I run the program it gives me multiple errors
and this happens in all the programs that you write. This is normal? is that
it gives error but when I call the function in the command window and assign
it to the variable it gives me the result .... Another question: how do I
call a function inside a script? Thank you!

(errors like this:
>> difuncao
error: 'x0' undefined near line 2 column 12
error: evaluating argument list element number 1
error: called from:
error:   /Users/monteirojp/Documents/FCUL - MATAPL/2º
ano/NUMERICA/exercicios em octave/difuncao.m at line 2, column 5
>>
)




works for me

func(1)
y =  4.8305
ans =  4.8305 



reply via email to

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