To get the graph of data
Show older comments
Hi,
I'm trying to get the graph using the data which I have now.
The simple shape of the graph that I'm trying to get is like this. Absorption is high only for the specific part.

Here, what I want to do is to have the graph like above one by rid-off the data1 from data 2.
You can easily understand when you see the drawing below

(data2) (data1)
By repeating this kind of process, I can get this kind of graph. This kind of graph is the goal of my work.

The graph of the data that I have is like this.

Here, I'm trying to make the graph by rid-off the data (7) from (8), rid-off the data of (6) from (7) and~~~like that.
So I made the code like this.
/////////////
clear;
closeall;
data=matrix(681,4,5);
for (a=[2:2:8]){
for (y=[1:5]){
filename= "Pitch_"+num2str(y)+"dia_"+num2str(a)+".fsp";
if (fileexists(filename)) {
load(filename);
z0 = transmission("R");
z1 = transmission("T");
data(:,a,y)=1-z0+z1;
}
data=matrix(681,4,5);
for (b=[1:2:7]){
for (y=[1:5]){
filename= "Pitch_"+num2str(y)+"dia_"+num2str(b)+".fsp";
if (fileexists(filename)) {
load(filename);
z0 = transmission("R");
z1 = transmission("T");
data(:,b,y)=1-z0+z1;
}
for (x=[1:4]){
2*x=a;
2*x=b+1;
data(:,x,y)=data(:,b,y)-data(:,a,y);
}
}}
else {
?"File not found.";
}
f = getdata("R","f");
lambda = 3e14/f;
x=[1:4];
pitch=[1:8];
for(j=[1:8]){
plot(lambda,data(:,x,j),"Wavelength(um)", "Absorpiton");
legend("20 nm","40 nm","60 nm", "80 nm");
setplot("x max",1.0);
setplot("x min",0.32);
setplot("y max",1.0);
setplot("y min",0);
}
///////////////
But it doesn't work at all.
Please give me the solution or other ways to get the graph that I want to get.
2 Comments
Mehmed Saad
on 9 Apr 2020
Edited: Mehmed Saad
on 9 Apr 2020
Try plotting it in db
i.e.
plot(Wavelength,db(Absorpiton))
Walter Roberson
on 9 Apr 2020
That is not MATLAB code. I do not know what programming language it is.
Answers (0)
Categories
Find more on Graph and Network Algorithms 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!