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

조회 수: 6 (최근 30일)
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

채택된 답변

sixwwwwww
sixwwwwww 2013년 10월 28일
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
Ankita
Ankita 2013년 10월 29일
Thank you very much indeed and I just wanted to seek your permission to disturb you directly maybe when I need more help?
sixwwwwww
sixwwwwww 2013년 10월 29일
Yes you can ask me if I will be able then I will help you

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

suhani nagpal
suhani nagpal 2013년 12월 16일
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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by