Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

I get an error. What caused it and how do I fix it?

1 Ansicht (letzte 30 Tage)
Yera Kim
Yera Kim am 13 Aug. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I want to deconvolute a measured spectrum (Sm) with pure spectrum (S0). The algorithm is first to match the grid beetween two spectra and then apply deconvolution routine of the matlab into the adjusted spectra. But I found errors in my code.
clear; clc
sm=load('n2o_gaussian.txt'); %loading signal with gaussian ILS
s0=load('n2o_noapodization.txt'); %loading pure spectrum
%v is wavenumber
%v0 is peak location
%vv0 is the wavenumber difference
v=s0(:,1)
v0=2217.241
vv0=v*ones(1,length(v0))-ones(length(v),1)*v0;
f=(10/(180/19))*(-5000/2:(5000/2-1))/5000;
vv01=ones(1,length(vv0)+100);
for i =51:length(vv0)+50
vv01(i)=vv0(i-50);
end
delta=abs(vv0(1)-vv0(2));
for i=1:50
vv01(i)=vv0(1)-delta*(51-i);
vv01(50+length(vv0)+i)=vv0(length(vv0))+delta*i;
end
%s0_interp1 = interp1( f, v, vv01, 'spline',0);
%deconvolution routine
ILS_deconv=[];
%deconvolution routine
for i = 1:length(v);
ILS_deconv(:,i)=deconv((sm(:,i)),(s0(:,i)),'same');
end
figure (1)
plot (Apo)
legend('Apodization function')
figure (2)
plot(f, real(ILS_deconv))
legend('ILS')
figure (3)
plot(sm(:,1),sm(:,2))
hold on
plot(s0(:,1),s0(:,2))
legend('Hitran spec, Gauss apodization','Hitran spec, no apodization')
could please anyone help me?
I also attached the spectra for the reference..
Thank you in advance
  2 Kommentare
Walter Roberson
Walter Roberson am 13 Aug. 2020
The error message does not match the code. Not unless part of the error message is missing, and you have your own deconv() function that calls deconvolution_200808 whatever that is.
which -all deconv
and I suspect that you will see a third party deconv.m
Harshendra Shah
Harshendra Shah am 18 Aug. 2020
Hi Yera,
I also suspect that you are using some custom 'deconv' function. The command mentioned by Walter will give the exact details. You can refer to the following link to check the usage of default 'deconv' function supplied with MATLAB:
Thanks,
Harshendra

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by