<div dir="ltr">Dear Gate users;<div><br></div><div>I want to calculate the fwhm of the SPECT system projection of point source. I tried the below Matlab code but it is not giving the satisfactory result of full-width-at half maximum.</div><div><br></div><div>The projection <b>image.jpg </b>and <b>image.mat</b> file is attached.</div><div><br></div><div>May I request you to please share your experience with the calculation of FWHM?</div><div><br></div><div>Thank you so much. </div><div><br></div><div><br></div><div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;border-top:1px solid rgb(233,233,233);padding-top:15px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"> V=max(max(img));</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">[M,N]=find(img==V);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">[fwhmx, fwhmy, fwhm] =FWHM_calculation(img,N, M,pixelSize);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Keyword" style="box-sizing:border-box;color:rgb(0,0,255)">function </span><span class="gmail-textWrapper" style="box-sizing:border-box">[fwhm_x,fwhm_y,fwhmT]=FWHM_calculation(Image,cx,cy,pixelSize)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% this function is used to calculate the full width half maximum of image</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% image: the input image, including a point source or square source in the</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% center</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% fwhm : the output value for fwhm</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">CC=ceil(cx);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">CR=ceil(cy);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"> N=25;</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">Column1=CC-N:CC+N ;</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"> Row1=CR-N:CR+N;</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  ROIimage=Image(Row1,Column1); </span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  profile_x=sum(ROIimage,1);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  X=1:1:2*N+1;</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  V=max(profile_x);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">        plot(X,profile_x,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'r-x'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'LineWidth'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,0.7,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'MarkerSize'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,5) </span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">     hold </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">on</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  </span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  [fitresult1, gof1] =createFitSPECTfwhm2(X,profile_x,V,N);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  rmse=gof1.rmse;</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  fwhm_x=2*sqrt(log(2))*pixelSize*fitresult1.c1</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  </span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  profile_y=sum(ROIimage,2);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  plot(X,profile_y,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'b-o'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'LineWidth'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,0.5,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'MarkerSize'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,3)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  V1=max(profile_y);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  </span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  [fitresult2, gof2] =createFitSPECTfwhm2(X,profile_y,V1,N);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  fwhm_y=2*sqrt(log(2))*pixelSize*fitresult2.c1</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  </span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  profile_yt=profile_y';</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  profile=(profile_x+ profile_yt)/2;</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">   plot(X,profile,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'k-*'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'LineWidth'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,0.7,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'MarkerSize'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,5)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  V=max(profile);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  [fitresult2, gof2] =createFitSPECTfwhm2(X,profile,V,N);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  fwhmT=2*sqrt(log(2))*pixelSize*fitresult2.c1</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  xlabel(</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Pixel Index'</span><span class="gmail-textWrapper" style="box-sizing:border-box">)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"> ylabel(</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Counts'</span><span class="gmail-textWrapper" style="box-sizing:border-box">)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"> title(</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Profile along Yaxis'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'fontSize'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,9)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"> legend(</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Profile along X-axis'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Profile along Y-axis'</span><span class="gmail-textWrapper" style="box-sizing:border-box">,</span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Average Profile'</span><span class="gmail-textWrapper" style="box-sizing:border-box">)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">  </span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Keyword" style="box-sizing:border-box;color:rgb(0,0,255)">function </span><span class="gmail-textWrapper" style="box-sizing:border-box">[fitresult, gof] = createFitSPECTfwhm2(X, profile,maxValue,Xcenter)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%CREATEFIT(X,PROFILE_X)</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%  Create a fit.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%  Data for 'untitled fit 1' fit:</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%      X Input : X</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%      Y Output: profile_x</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%  Output:</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%      fitresult : a fit object representing the fit.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%      gof : structure with goodness-of fit info.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%  See also FIT, CFIT, SFIT.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%  Auto-generated by MATLAB on 26-Mar-2014 11:10:32</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">%% Fit: 'untitled fit 1'.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">[xData, yData] = prepareCurveData( X, profile );</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% Set up fittype and options.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">ft = fittype( </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'gauss1' </span><span class="gmail-textWrapper" style="box-sizing:border-box">);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% ft = fittype( 'gauss2' );</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">opts = fitoptions( ft );</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">opts.Display = </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Off'</span><span class="gmail-textWrapper" style="box-sizing:border-box">;</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% opts.Lower = [-Inf -Inf 0];</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">opts.Lower = [-Inf -Inf 0];</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">opts.StartPoint = [maxValue Xcenter 1];</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">opts.Upper = [Inf Inf Inf];</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% opts.Upper = [Inf Inf Inf];</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box"></span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% Fit model to data.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">[fitresult, gof] = fit( xData, yData, ft, opts );</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% Plot fit with data.</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">figure( </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Name'</span><span class="gmail-textWrapper" style="box-sizing:border-box">, </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Gaussian fit 1' </span><span class="gmail-textWrapper" style="box-sizing:border-box">);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">h = plot( fitresult, xData, yData );</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">legend( h, </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'profile_x vs. X'</span><span class="gmail-textWrapper" style="box-sizing:border-box">, </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Gaussian fit 1'</span><span class="gmail-textWrapper" style="box-sizing:border-box">, </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'Location'</span><span class="gmail-textWrapper" style="box-sizing:border-box">, </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'NorthEast' </span><span class="gmail-textWrapper" style="box-sizing:border-box">);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper gmail-Comment" style="box-sizing:border-box;color:rgb(34,139,34)">% Label axes</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">xlabel( </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'X' </span><span class="gmail-textWrapper" style="box-sizing:border-box">);</span></span></div><div class="gmail-lineNode gmail-mwRichTextComponentLine gmail-plainTextFixedSize" style="box-sizing:border-box;padding-left:10px;border-left:1px solid rgb(233,233,233);border-right:1px solid rgb(233,233,233);padding-bottom:4px;color:rgb(0,0,0);font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:14px"><span class="gmail-textBox" style="box-sizing:border-box;white-space:pre"><span class="gmail-textWrapper" style="box-sizing:border-box">ylabel( </span><span class="gmail-textWrapper gmail-String" style="box-sizing:border-box;color:rgb(160,32,240)">'profile_x' </span><span class="gmail-textWrapper" style="box-sizing:border-box">);</span></span></div></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div><img src="cid:ii_kq0nunab0" alt="pointSource.jpg" width="521" height="453"><br></div><div><br></div><div><br></div><div><img src="cid:ii_kq0nvb5m1" alt="fitFunc.jpg" width="521" height="391"><br></div><div><br></div><div><br></div><div><br></div><div>I also asked<a href="https://www.mathworks.com/matlabcentral/answers/855595-how-to-calculate-image-resolution-full-width-at-half-maximum-of-a-point-source?s_tid=mlc_ans_email_view#answer_724450"> this question</a> on <a href="http://mathwork.com">mathwork.com</a> but yet no acceptable solution.</div><div><br></div><div>Thank you for your coopeartion.</div><div><br></div></div></div></div></div></div></div></div>