plot 3D data in yz plane
이전 댓글 표시
I have data obtained from pinhole scanning. The data consist of 4 columns x, y, z and intensity.I want to plot the beam intensity in yz plane to see how the beam looks like. The problem is that I have got 240 graphs which is the number of points along x axis and it is hard to see the full shape of the beam. Is there any other way to represent the data and plot it in yz verses intensity. I appreciate your help. Here is the code i have written.
close all;
clear all;
x = [2850:2.5:2850+2.5*239]; % scan along x axis start with 2850 and increment by 2.5 micron (240 points)
y = [1200:2.5:1200+2.5*159]; % scan along y axis start with 1200 and increment by 2.5 micron for 160 points
Path = 'C:\.5um_Z-900_to_700_Aper10um\SCAN__XYZ__2017_12_11_15_58_30_mUmU_no12_240x160_step2.5um_Z-900_to_700_Aper10um';
Data = zeros(240,160,16);
k = 0;
for j = 1:16
for i = 1:160
k = k+1;
DataTemp = importdata([Path '\lineScan (' num2str(k) ').txt']);
Data(:,i,j)= DataTemp(1:240,4);
end
end
for z=1:240
DATA = Data(:,:,z);
subplot(4,4,z);imagesc(Data(:,:,z)')
end
댓글 수: 8
KSSV
2018년 1월 9일
YOu can plot all the data in 3D and change the view you wanted.
Ben Baker
2018년 1월 9일
KSSV
2018년 1월 9일
Huumhu......It can be done..but how is your data? It is (x,y,z)..it is a structured data? Or a unstructured data? Attach your data here for code/ help.
Ben Baker
2018년 1월 9일
KSSV
2018년 1월 9일
Data is not attached.....
Ben Baker
2018년 1월 9일
KSSV
2018년 1월 9일
files = dir('*.txt') ;
N = length(files) ;
figure
hold on
for i = 1:N
i
data = importdata(files(i).name) ;
x = data(:,1) ; y = data(:,2) ; z = data(:,3) ;
c = data(:,4) ;
plot3(x,y,z)
end
This is a point plot of the given files.....we need to arrange the data from the files...to get what you want.
Ben Baker
2018년 1월 9일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!