How to Begin a Numerical Analysis Project in Matlab?

In summary, the conversation is about a project that needs to be completed within a week and requires knowledge of C++ and elementary numerical analysis. The person is unsure of how to program it and has limited experience with Matlab. They are asking for guidance on how to get started and someone provides a code that involves setting a value for N and calculating a sum using a for loop. The person thanks them and expresses interest in learning more about programming.
  • #1
aleee
17
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
  • #2
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;
 
  • #3
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.
 

Related to How to Begin a Numerical Analysis Project in Matlab?

1. What is Matlab and what can it do?

Matlab is a high-level programming language and interactive environment developed by MathWorks. It is commonly used in engineering, mathematics, and scientific research for data analysis, visualization, and computational tasks.

2. How do I get started with Matlab?

To get started with Matlab, you will need to install the software on your computer. You can purchase a license or use the free trial version. Once Matlab is installed, you can launch the program and start writing and executing code.

3. What are the basic syntax and commands in Matlab?

The basic syntax in Matlab is similar to other programming languages, with commands followed by parentheses and semicolons to end statements. Some common commands in Matlab include disp for displaying text, fprintf for formatted printing, and input for user input.

4. Can I use Matlab for data analysis and visualization?

Yes, Matlab is commonly used for data analysis and visualization. It has built-in functions and tools for working with data, including statistical analysis, curve fitting, and creating plots and graphs.

5. How can I apply Matlab to a beginner project?

You can apply Matlab to a beginner project by identifying a problem or task that can be solved using programming and data analysis. This could be creating a simple calculator, analyzing a dataset, or creating a basic game. Then, use the skills and concepts learned in Matlab to write code and solve the problem.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
22
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
764
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
Back
Top