weixin_54229823
L·道·H G
2021-03-04 03:16

matlab创建新数组并用于卷积

 What I will do is provide you with an example:
 
%%%%%%% Start of MATLAB code %%%%%%%%%%%
%Make a Gaussian profile (this is your own code)
x = -1:0.01:1;
y = normpdf(x, 0, 0.035);
y = y./max(y); %normalise this profile.
 
%Make a test array, I advised you to do this already.
test=zeros(1000,1);
test(100)=1;
test(500)=1;
test(520)=1;
test(700)=1;
 
%perform the convolution
c_test=conv(test,y,'same');
 
%plot the results
stem(test);
hold
plot(c_test);  %You need to think carefully about the x axis here.
 
%%%%%%% End of MATLAB code %%%%%%%%%%%
 
 
Following this example should get you up and running. You need to give some thought to the wavelength axis. At the moment the wavelength values in your ‘landa’ array are fine for calculating the new intensity, but they are not suitable for plotting the convoluted spectrum as they are discontinuous. You need to make a new landa array, something like landa_new = 300:0.001:320; of course, you’ll have to use this new array for the convolution too, this will need some careful testing to make sure everything is ok.
 You should make the simulated spectrum for many different temperatures and compare them with the experimental data to find the closest match, this will tell you what temperature the experimental data is closest to.

这是我的Matlab的代码,目的是原图通过和高斯函数进行卷积做成一个合成光谱图,在306到310这个区间形成4个峰值,这4个峰值对应的横轴都是非整数。现在迫切要解决的问题是创建新的波长数组并运用于卷积,进而得到合适的合成光谱图

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

为你推荐