Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have data in my file format .dat. The data generated using 'C' program. This data file having 3 columns. How can I import this file using Mathematica? Is is possible to plot using ListDensityPlot() function using these three columns of data?

share|improve this question
Hi Sudharsan. Use Import to import the data. There's a tutorial 'tutorial/ImportingAndExportingData' which will help you. – cormullion Apr 24 at 8:27
ListDensityPlot would be appropriate if one of the three values is a function value and the other two form x,y co-ordinates. – image_doctor Apr 24 at 9:56

closed as too localized by Sjoerd C. de Vries, Yves Klett, halirutan, Oleksandr R., Simon Woods Apr 24 at 11:07

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

This can be done. Your description looks as if the file you get from C is a dat file. Let us assume it is called data.dat. One way to easily import it is to first save your notebook into the directory, where you have the file in question, and then import the data.dat file into this notebook as follows:

dataList = Import[NotebookDirectory[] <> "data.dat"]

Then you can plot it by

 ListPlot3D[dataList]

You might like checking Menu/Help/Import and Menu/Help/ListPlot3D where analogous operations are richly described.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.