Vector field graph from a data file.

1 回表示 (過去 30 日間)
Munawar Karim
Munawar Karim 2024 年 8 月 2 日
コメント済み: Voss 2024 年 8 月 5 日
I am totally new to Matlab. I have data on file. I need to draw a 2-D vector field graph of the data.
I would appreciate detailed instructions as this is my first attempt as using Matlab.
Much apprrciate any advice.
Regards

採用された回答

Voss
Voss 2024 年 8 月 2 日
readmatrix might be useful to read the file, and quiver might be useful to create the plot.
  5 件のコメント
Munawar Karim
Munawar Karim 2024 年 8 月 4 日
I have uploaded my data file.
The range of values is huge so I have entered the log of the numbers.
Regreatbly no idea how to proceed.
Thanks again.
Voss
Voss 2024 年 8 月 5 日
Thanks for the file. Here is some example code that reads the file and creates a quiver plot; you can use it as a reference and adapt it to make the plot you actually want to see.
M = readmatrix('Compilation4.xlsx')
M = 759x11
1.0e+05 * 0.0000 0.0000 0.0000 0.0000 0.0000 1.3040 0.0114 -0.0003 -0.0004 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.3038 0.0228 -0.0003 -0.0004 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.3032 0.0455 -0.0003 -0.0004 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.3022 0.0682 -0.0003 -0.0004 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.3008 0.0910 -0.0003 -0.0004 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 1.2990 0.1137 -0.0003 -0.0004 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 1.2842 0.2264 -0.0003 -0.0003 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 1.2596 0.3375 -0.0003 -0.0003 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0002 1.2254 0.4460 -0.0003 -0.0003 0.0001 0.0000 0.0000 0.0000 0.0000 0.0000 0.0003 1.1818 0.5511 -0.0003 -0.0003 0.0001 0.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x = M(:,1);
y = M(:,2);
u = cos(M(:,3));
v = sin(M(:,3));
quiver(x,y,u,v)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by