|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
expressing a matlab statementHi
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@...
_______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: expressing a matlab statementDr 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@... <mailto:drgovenshiba@...> > ------------------------------------------------------------------------ > > _______________________________________________ > Help-octave mailing list > Help-octave@... > https://www.cae.wisc.edu/mailman/listinfo/help-octave > This is a quadratic in y , therefore there are two solutions for y y^2 -2y -x-1=0 y= (-b +- sqrt(b^2 -4ac)) /2a the generic solution. y1=(2+sqrt(4-4*(-x-1)))/2 or y1=1+sqrt(2+x) and y2=1-sqrt(2+x) hope this helps. _______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: expressing a matlab statementFirst, 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> |
|
|
Re: expressing a matlab statementOn Mar 6, 2008, at 4:47 AM, 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 Matlab/Octave are computational applications. Assuming I got the algebra correct, y1 = 1 + sqrt(1 + 4*(1+x)); y2 = 1 - sqrt(1 + 4*(1+x)); y = union(y1,y2); If you're looking for a program that will provide a symbolic solution (i.e. start with y^2-2y=x+1 and provide an equation representing y), take a look at Maxima. http://maxima.sourceforge.net/ Ben _______________________________________________ Help-octave mailing list Help-octave@... https://www.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: expressing a matlab statementBen IMHO and also from a pedagogical point of view the worst thing to do is to provide beginners with all-embracing answers. Fortunately your presented result is that far off from the algebraical correct result that the questioner still has the chance to improve his/her calculational skills by solving it alone. rf Rolf Fabian
<r dot fabian at jacobs-university dot de> |
| Free embeddable forum powered by Nabble | Forum Help |