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
KSSV 2018년 1월 9일
YOu can plot all the data in 3D and change the view you wanted.
Ben Baker
Ben Baker 2018년 1월 9일
Thanks for replying. Any idea or code to start with?
KSSV
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
Ben Baker 2018년 1월 9일
It is structured data x, y, z and intensity. Here i am giving you a brief on what the data is representing and how it obtained. The pinhole scans the laser beam first in x axis and store the data in one single line (one file) then increment by 2.5 micron in y direction and scan as a second line (second file) and like this until y= 160 (160 files in the data). Then z changes by 100 micron. Then start the scanning again as before until y=160 and z increment by 100 micron too. This process is repeated until z=16. That means 160 x 16= 2560, which is the number of files data i am attaching. I want to see the beam in xy plane v intensity and yz plane vs intensity. Here i attached the data. Thank you for help
KSSV
KSSV 2018년 1월 9일
Data is not attached.....
Ben Baker
Ben Baker 2018년 1월 9일
Here is the Data.
KSSV
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
Ben Baker 2018년 1월 9일
Here is what i got from the code i wrote. the plot in xy plane vs intensity. This is how the beam looks like.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2018년 1월 9일

댓글:

2018년 1월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by