I with C ++ or MATLAB : Simpson's rule

  • MATLAB
  • Thread starter xpoormanx
  • Start date
  • Tags
    Matlab
In summary: However, if you are familiar with both C++ and MATLAB, then MATLAB may be easier as it has fewer complexities that may not be relevant to your problem. It is not recommended to use a programming language you are not familiar with for this task.
  • #1
xpoormanx
2
0
http://img55.imageshack.us/img55/3461/scan0001op5.jpg


Thank You !
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
You understand, don't you, that no one here is going to do your homework for you! The problem does say, after all, "you have to write the code yourself". You might start by writing out exactly what "Simpson's rule" is.
 
  • #3
And please refrain from messing up the page layout by posting stupidly oversized imageshack images.
 
  • #4
It is not homework it is something extra
I just need help on it

which one more easy using C ++ or MATLAB
 
  • #5
xpoormanx said:
It is not homework it is something extra
I just need help on it

which one more easy using C ++ or MATLAB

If you already know how to use MATLAB then I am fairly certain that using MATLAB will be easier. C++ has various complexities which are not relevant or helpful to solving your particular problem which in MATLAB you will simply not have to worry about.
 
  • #6
I hate this too big image. could you type these words in post instead?
 
  • #7
xpoormanx said:
It is not homework it is something extra
I just need help on it

which one more easy using C ++ or MATLAB

It will be easiest to use whatever programming language you already know, and have installed on your computer.
 

FAQ: I with C ++ or MATLAB : Simpson's rule

1. What is Simpson's rule?

Simpson's rule is a numerical integration method used to approximate the area under a curve. It involves dividing the area into smaller segments and using quadratic polynomials to approximate the curve within each segment.

2. How does Simpson's rule work?

Simpson's rule works by taking the average of the left and right Riemann sums for each segment, and then combining those averages using a weighted average. This results in a more accurate approximation of the area under the curve compared to other numerical integration methods.

3. When should I use Simpson's rule?

Simpson's rule is best used when the function being integrated is smooth and can be approximated by quadratic polynomials. It is also useful when the number of segments used is relatively large, as it can provide a more accurate estimation of the area under the curve compared to other methods.

4. What are the advantages of using Simpson's rule?

Simpson's rule is relatively easy to implement and can provide a more accurate estimation of the area under a curve compared to other numerical integration methods. It is also versatile and can be used for a wide range of functions.

5. Are there any limitations to using Simpson's rule?

One limitation of Simpson's rule is that it can only be applied to functions with an even number of segments. It may also not provide accurate results for functions with sharp turns or discontinuities. Additionally, it may require a larger number of segments to achieve a desired level of accuracy compared to other integration methods.

Similar threads

Replies
5
Views
2K
Replies
5
Views
2K
Replies
5
Views
890
Replies
3
Views
1K
Replies
10
Views
2K
Replies
22
Views
3K
Replies
9
Views
2K
Replies
23
Views
4K
Back
Top