Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need help with integral

  1. Dec 23, 2015 #1
    I carried out a physics experiment and I wanted to analysis the problem with matlab. I have some code in matlab that "works" as in it gives ok result but the numbers used are quite nonsensical, I need help making the reworking the equation with real numbers. I am not sure if this is the correct thread, if not sorry. Here is my code:

    Code (Matlab M):

    format long;
    clear all;

    fid=fopen('plot.txt','w')  %Êý¾ÝдÔÚplot.txt
    for m=1:300
        p(m)=m*0.0001-0.015;   %¿ÉÒÔµ÷Õû×÷ͼ²½³¤
        for r=0.0:dddr:0.010   %¸ù¾ÝÊÕÁ²ÐÔµ÷Õû»ý·ÖÉÏÏ޺Ͳ½³¤
        fprintf(fid,'%9.4f  %9.4f  \n',p(m),I(m));
    fclose all;
    hold off
        plot(p,I);  %»Í¼
    hold on
    My main problem is using very large numbers like "5500000". What I would like to do, is make the exp(a*exp(b*r^2)) component be the part of the function that determines the number of rings, where a=2Npi and N would determine the number of rings. However I am not sure how to go about normalizing the rest of the constants so that this would be the case.

    Mod note: I added code tags. Please do that every time you post code.
  2. jcsd
  3. Dec 23, 2015 #2


    User Avatar

    Staff: Mentor

    You will have to give more details. What physical problem are you looking at? What is the code actually doing?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook