expressing a matlab statement

Rolf Fabian Rolf.Fabian at gmx.de
Thu Mar 6 06:09:56 CST 2008




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: drgovenshiba at vodamail.co.za
> 
> 

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.



More information about the Help-octave mailing list