フィルターのクリア

3D-Surface from .dat-File

4 ビュー (過去 30 日間)
Trier87
Trier87 2012 年 12 月 15 日
回答済み: ebot joel 2018 年 6 月 1 日
Hello, i have a test.dat File with a Variable Buff that has 3 columns. The Code for this looks like this:
Buff = zeros(numel(850:10:870)*numel(1286:10:1306),3);
Ctr = 1;
for EG = 1286:10:1306
for PC=850:10:870
Main
Buff(Ctr, 1) = PC;
Buff(Ctr, 2) = EG;
Buff(Ctr, 3) = XXX;
Ctr = Ctr+1;
end
end
save test.dat Buff;
The Output looks like this:
Column1 Column2 Column3
(Iteration PC=850:10:870 ) (Iteration EG=1286:10:1306) (XXX)
850 1286 ...
860 1286 ...
870 1286 ...
--- --- ---
850 1296 ...
860 1296 ...
870 1296 ...
--- --- ---
850 1306 ...
860 1306 ...
870 1306 ...
Now i want make a 3D-plot Surface of this data/values. How i can load the values of the columns from test.dat into a plot and the next question is: Must i use the command meshgrid or is this possible with interpolation between the serveral points.
Thank you!

回答 (1 件)

ebot joel
ebot joel 2018 年 6 月 1 日
M=dlmread('test.dat')
plot3(M(:,1.),M(:,2),M(:,3))

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by