Hi,
I need some help with troubleshooting this code. It keeps giving me the error
Error in Assigment2problem1function (line 16)
It11=I0f.*10.^(-A1);
Error using .*
Matrix dimensions must agree.
function [ Absorbance1,Absorbance2 ] = Assigment2problem1function(I0,E1,E2,l,Nrep)%I0=100000, E1=10000, E2=20000, l=1, Nrep=3
% Detailed explanation goes here
% A = ECl beer-lambert law
% A = -log T = -log(It/Io)=log(I0)-log(It)
% A = Absorbance
%It = Intensity of Transmitted photons
%I0 = Initial Intensity of photons
% Assigment2problem1function(100000,10000,20000,1,3)
C=10:10:50*(10^-6);SD=sqrt(I0);for i=1:NrepI0f=I0+rand(1,Nrep)*SD;A1=E1*C*l;It11=I0f.*10.^(-A1);SD21=sqrt(It11);It12=It11+SD21.*rand(1,1);Absorbance1=log(I0)-log(It12)A2=E2*C*l;It21=I0f.*10.^(-A2);SD21=sqrt(It21);It22=It21+SD21.*rand(1,1);Absorbance2=log(I0)-log(It22)end
Best Answer