How can I draw a 3D Free Energy Diagram from a text file which has 3 columns?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposta accettata
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
Più risposte (1)
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
0 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!