plot 3D data in yz plane
Show older comments
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 Comments
KSSV
on 9 Jan 2018
YOu can plot all the data in 3D and change the view you wanted.
Ben Baker
on 9 Jan 2018
KSSV
on 9 Jan 2018
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
on 9 Jan 2018
KSSV
on 9 Jan 2018
Data is not attached.....
Ben Baker
on 9 Jan 2018
KSSV
on 9 Jan 2018
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
on 9 Jan 2018
Answers (0)
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!