Loading and plotting .dat files

5 visualizzazioni (ultimi 30 giorni)
Becky
Becky il 17 Nov 2011
My code written in the editor saves the data generated running the program into two files. In the matlab command window I want to load these files in order to plot the data stored into them.
However after searching the matlab help and trying load/uiimport/importdata etc I just get error messages or if it is loaded I am unsure how to then plot the data?
This is the error message I get when using load:
load radcon_t.dat
??? Error using ==> load
Number of columns on line 1 of ASCII file N:\My Documents\Dissertation\radcon_t.dat
I cannot understand how to solve this error so I was wondering if anyone could help with this problem?
Any help is much appreciated!! Thanks must be the same as previous lines.

Risposte (2)

Fangjun Jiang
Fangjun Jiang il 17 Nov 2011
How is the data saved? If there is no particular reason, why don't save it as .mat file, instead of the ASCII format? It's much easier and you can recover the variable name. See help save.
If you have to save the data in ASCII format, then try load it using d=importdata('radcon_t.dat'), or post a snip of the data file so others can see what is the problem.

Becky
Becky il 17 Nov 2011
I tried using d=importdata('radcon_t.dat')
and got this output:
d=importdata('radcon_t.dat')
d =
data: [33x3 double]
textdata: {'# p(hPa) T(K) Heating by H-fluxes (K/day)'}
I dont understand why it is not showing all the numerical data just [33x3 double], and then how I can plot from that?

Categorie

Scopri di più su Programming in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by