 CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

1. ## MatLab help needed

Hi
Please, help me with this one:
Program Eyler;
Uses
Crt;
Const
H=0.1;
Var
X,y:array[0..100] of real;
I:integer;
Function f(x,y:real):real;
Begin
F:=0.218*(x*x+sin(1.6*x)+0.718*y);
End;
Begin
Clrscr;
For i:=0 to 9 do
Begin
X:=0.2; y:=1.2;
X[i+1]:=x[i]+h;
Y[i+1]:=y[i]+f(x[i],y[i])*h; {Eiler's formula}
Writeln (x[,I,]=, x[i]:3:2);
Writeln (y[,I,]=, y[i]:3:2);
End;
End.

Results
Х=0.20 y=1.20
Х=0.30 y=1.29
Х=0.40 y=1.40
Х=0.50 y=1.52
Х=0.60 y=1.65
Х=0.70 y=1.79
Х=0.80 y=1.95
Х=0.90 y=2.12
Х=1.00 y=2.31
Х=1.10 y=2.52
Х=1.20 y=2.75

Thanks.  Reply With Quote

2. ## Re: MatLab help needed

I've been looking for some instant MatLab sections on MathsNinja and MathsGurus, Perhaps, any ideas on the process. I know that it will take perhaps several pages to write down in detail.
Last edited by 2kaud; May 10th, 2018 at 08:32 AM. Reason: Removed advertising link  Reply With Quote

3. ## Re: MatLab help needed

Update:

Found the Euler Method Matlab Code thread on MathWorks. Solved.  Reply With Quote

4. ## Re: MatLab help needed  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
• 