필터 지우기
필터 지우기

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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by