MATLAB: Importing Files and Creating Contours

  • Context: MATLAB 
  • Thread starter Thread starter MathematicalPhysics
  • Start date Start date
  • Tags Tags
    files Matlab
Click For Summary
SUMMARY

Matt is using C++ to simulate charge dissipation and has exported the results as a matrix in a .txt file. He successfully imported this file into MATLAB using the "File --> Import Data" function. To visualize the data, he seeks guidance on using the contour function in MATLAB. A suggestion was made to utilize the command "help contour" in the MATLAB command window for further assistance.

PREREQUISITES
  • Basic understanding of C++ programming and file output.
  • Familiarity with MATLAB interface and data import procedures.
  • Knowledge of MATLAB's contour function for data visualization.
  • Understanding of matrix representation of numerical data.
NEXT STEPS
  • Explore MATLAB's contour function syntax and options.
  • Learn how to manipulate matrices in MATLAB for better data representation.
  • Research additional MATLAB visualization tools such as surf and mesh.
  • Review MATLAB documentation on importing and exporting data files.
USEFUL FOR

Researchers, engineers, and students working with C++ simulations who need to visualize numerical data in MATLAB.

MathematicalPhysics
Messages
40
Reaction score
0
Hey! I am using c++ to simulate charges dissipating. I've written the output to a file in the form of a matrix, so in the file is just a matrix of numbers showing equipotentials etc.

I want to show the contours by using MATLAB. I'm not used to working in MATLAB but I tried! I clicked file --> import data, then pointed it to the output file from c++ (just a .txt file).

After clicking next a few times it appears to have imported the correct file.

Now what do I do? Reading textbooks, I gather its something like:

>contour(...)

Im really not sure about this! I hope I don't have to start learning MATLAB from the beginning just to work this out! The point of my project is to use c++ to work out the charge dissipation, which I've done but wouldn't it be nice to have some pictures?!

Thanks in advance,

Matt
 
Physics news on Phys.org
MathematicalPhysics said:
Hey! I am using c++ to simulate charges dissipating. I've written the output to a file in the form of a matrix, so in the file is just a matrix of numbers showing equipotentials etc.

I want to show the contours by using MATLAB. I'm not used to working in MATLAB but I tried! I clicked file --> import data, then pointed it to the output file from c++ (just a .txt file).

After clicking next a few times it appears to have imported the correct file.

Now what do I do? Reading textbooks, I gather its something like:

>contour(...)

Im really not sure about this! I hope I don't have to start learning MATLAB from the beginning just to work this out! The point of my project is to use c++ to work out the charge dissipation, which I've done but wouldn't it be nice to have some pictures?!

Thanks in advance,

Matt

You can writte "help contour" on the command window.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
10K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 7 ·
Replies
7
Views
9K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K