MATLAB How to Begin a Numerical Analysis Project in Matlab?

AI Thread Summary
To begin a numerical analysis project in Matlab, it's essential to understand the basic structure of the code provided, which calculates a sum based on a specified value of n. The user is encouraged to experiment with different values of n, such as 10, 100, or 10000, to observe how the results change. The code snippet sums the series 1/i^4 and compares the result to pi^4/90 to estimate the error E. While the user has limited experience with Matlab, they express a desire to complete the project to enhance their programming skills. Engaging with the code and seeking clarification on specific questions will aid in their learning process.
aleee
Messages
17
Reaction score
0
This is the project.
2l2xcg.jpg

I have until next week. The requirement for the class is c++. (elementary numerical analysis btw). I have an idea of what is going to happen for the results but i have no idea on how to program it. I've have probably used Matlab 3 or 4 times using a premade program. Can anyone point me in the right direction on how to start.
Thanks in advance.
 
Physics news on Phys.org
Here is the code:

n=10; <this is N, set it to different values, i.e. 10, 100,1000,10000,20000

sum=0;
for i=1:n
sum=sum+1/i^4;
endfor

E=sum-pi^4/90;
 
Thanks for the code. I got a few questions to it, but i want to first complete it for i can learn a little programming of it.
 

Similar threads

Replies
22
Views
4K
Replies
3
Views
2K
Replies
1
Views
3K
Replies
3
Views
2K
Replies
3
Views
2K
Replies
4
Views
3K
Replies
6
Views
2K
Back
Top