Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

how add data continuous in a for loop

$
0
0
hi guys
my code is shown below. frist i read data from a excel file. the i have a for loop to read 11 rows from the excel. I do some calculations next. when i run this file i obtain a series absorption profiles overlapped to each other due to the hold on function plotted. what i would like to do is some how continuously add the absorption data called absorbance such that in the end all absorption data are added together and i able to see on the plot the summation of all the absorption data. please help!

function simulate = absorptionprofile

linecenter=xlsread('selection.xlsx','C:C');

linestrength=xlsread('selection.xlsx','E:E');

gammair=xlsread('selection.xlsx','G:G');

gammaself=xlsread('selection.xlsx','H:H');

linewidth=0.9852*gammair+gammaself*0.0148;

for k=340:349
v=6765:0.01:7230;
x=(v-linecenter(k))/linewidth(k);
lineshape=(1./(pi*linewidth(k))).*(1./(1+x.^2));
absorbance=linestrength(k).*lineshape
hold on
plot(x,absorbance)
end

Viewing all articles
Browse latest Browse all 2703

Trending Articles