フィルターのクリア

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

9 ビュー (過去 30 日間)
Ankita
Ankita 2013 年 10 月 28 日
回答済み: suhani nagpal 2013 年 12 月 16 日
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 Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by