Exploring Resources and Differences in Computational Physics -MATLAB vs C++

In summary, the conversation was about writing a MATLAB program that uses a M-function and the person was looking for websites with sample code. They also asked about the differences between programming in C++ and MATLAB. The suggestion was to check out MATLAB Central and other tutorials for m-files. The person thanked for the help and expressed appreciation for any assistance.
  • #1
sapiental
118
0
Hello,

I have to write a MATLAB program for a problem that utilizes a M-function. I was curious if you guys knew of any good websites that have some sample code for such problems.

Also, I am somewhat familiar with programming in C++. How much does MATLAB differ from this language?

Any help is greatly appreciated.

Thanks.
 
Physics news on Phys.org
  • #2
Matlab central is one pretty solid place to start :

http://www.mathworks.com/matlabcentral/

...there are lots of tutorials out there about m - files (google and take your pick, or if someone else has an opinion about what is 'best' ...), and MATLAB documentation is a good reference to use as well.
 
  • #3


Hi there,

Computational Physics using MATLAB is a fascinating field that combines the power of programming with the principles of physics. As for your question, there are many resources available online that provide sample codes for various problems in computational physics using MATLAB. Some popular websites include MathWorks, MATLAB Central, and GitHub. These websites offer a wide range of codes, tutorials, and forums where you can find solutions to your specific problem or even ask for help from the community.

In terms of differences between MATLAB and C++, there are a few key distinctions to keep in mind. Firstly, MATLAB is an interpreted language, meaning that it executes code line by line, while C++ is a compiled language that converts the entire code into machine-readable instructions before execution. Secondly, MATLAB has built-in functions and libraries specifically designed for scientific computing, making it easier to perform complex mathematical operations compared to C++. Lastly, MATLAB has a more user-friendly interface and syntax, making it easier for beginners to learn and use.

I hope this helps in your journey to mastering computational physics using MATLAB. Good luck with your program!
 

Related to Exploring Resources and Differences in Computational Physics -MATLAB vs C++

1. What is Computational Physics and how does MATLAB play a role?

Computational Physics is the use of computer algorithms and numerical methods to solve physical problems. MATLAB is a popular programming language and software tool used in Computational Physics for its ability to handle complex mathematical calculations and data analysis.

2. What are some basic skills needed for working with Computational Physics in MATLAB?

Some basic skills needed for working with Computational Physics in MATLAB include knowledge of programming concepts, familiarity with the MATLAB environment, and proficiency in mathematical methods and equations.

3. Can MATLAB be used for both simple and complex problems in Computational Physics?

Yes, MATLAB is a versatile tool that can be used for both simple and complex problems in Computational Physics. It has a wide range of built-in functions and toolboxes that can handle various types of calculations and simulations.

4. How can MATLAB help in visualizing and analyzing data in Computational Physics?

MATLAB has powerful visualization and data analysis capabilities that make it a useful tool in Computational Physics. It can create 2D and 3D plots, animations, and interactive graphs to help visualize and interpret complex data.

5. Are there any resources available for learning how to use MATLAB for Computational Physics?

Yes, there are many online tutorials, courses, and documentation available for learning how to use MATLAB for Computational Physics. Additionally, MATLAB has a built-in help function and a large user community that can provide support and resources.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • STEM Academic Advising
Replies
9
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
Replies
4
Views
833
  • STEM Career Guidance
Replies
3
Views
2K
  • Quantum Interpretations and Foundations
6
Replies
204
Views
7K
  • Programming and Computer Science
Replies
6
Views
1K
  • Computing and Technology
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
17
Views
2K
Back
Top