help-octave
[Top][All Lists]
Advanced

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

Re: expressing a matlab statement


From: Rolf Fabian
Subject: Re: expressing a matlab statement
Date: Thu, 6 Mar 2008 04:09:56 -0800 (PST)



Dr Preyesh T. Goven Shiba wrote:
> 
> Hi 
> 
> I'm a beginner with the use of matlab and octave... Can someone please
> help me....How do i express the function y as a amtlab statement for the
> following expression
> 
> 
> y^2 - 2y = x + 1
> 
> Thankx
> Preyesh
> 
> Email: address@hidden
> 
> 

First, solve the quadratic equation in varible y
"y^2 - 2*y -(x+1) = 0"
using standard school math
and you'll get 
y = ... (you should do it by yourself!)

Then, at the Octave prompt, type:
:> function y = myfunc(x) y = .... (your result from above); endfunction

afterwards, you're able to type e.g




-----
Rolf Fabian
<r dot fabian at jacobs-university dot de>

-- 
View this message in context: 
http://www.nabble.com/expressing-a-matlab-statement-tp15871511p15871884.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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