Azzera filtri
Azzera filtri

How can I draw a 3D Free Energy Diagram from a text file which has 3 columns?

9 visualizzazioni (ultimi 30 giorni)
Apologies if the questions of this type have been already asked but I am a complete novice in MATLAB and am seeking help to draw a free energy diagram from a text file which looks like the following: (I have also attached the file) ------------------------------------------------------------------------------ 4.20766 0.13450 15.50000 4.21207 0.13450 15.50000 4.21647 0.13450 15.50000 4.22088 0.13450 14.20000 4.22528 0.13450 11.60000 4.22968 0.13450 12.90000 4.23409 0.13450 14.20000 4.23849 0.13450 15.50000 4.24289 0.13450 15.50000 ------------------------------------------------------------------------------------ There are 16000 rows and 3 columns. The first two are my parameters and third column is the free energy value. I want to plot this data and visualize as a 3D Free energy diagram. As I am novice, I might need a detailed help please.
Kind regards

Risposta accettata

sixwwwwww
sixwwwwww il 28 Ott 2013
Dear Ankita, you can plot 3 columns of equal length as follows:
ID = fopen('filename.txt');
data = textscan(ID, '%f%f%f');
fclose(ID);
min(data{1})
max(data{1})
plot3(data{1}, data{2}, data{3}, '*-'), xlabel('x'), ylabel('y'), zlabel('Free energy')
I hope it helps. Good luck!
  16 Commenti
Ankita
Ankita il 29 Ott 2013
Thank you very much indeed and I just wanted to seek your permission to disturb you directly maybe when I need more help?

Accedi per commentare.

Più risposte (1)

suhani nagpal
suhani nagpal il 16 Dic 2013
Greetings
I used your reshape script for my test file. The following error is generated:
??? Error using ==> reshape Product of known dimensions, 1641, not divisible into total number of elements, 1681.
Error in ==> untitled at 10 X = reshape(x, reshape_range, []);
Can you please assist regarding this? I'm new to matlab. Thanks

Community Treasure Hunt

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

Start Hunting!

Translated by