1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab for summation

  1. Sep 23, 2010 #1

    I am trying to write a code for summation in matlab. I have two different text files with T and t in them.... I need to write a code that calculates....


    So, I have T1, T2, T3,T4,,,,,,, and t1 t2 t3 t4.... and i need to use the above equation.... this is the code i wrote...

    clear all
    load time.txt
    load temperature.txt

    T = temperature;
    t = time;
    for i = 1:149
    x(i) = [T(i+1)-T(i)]/[sqrt(t(150)-t(i+1))+sqrt(t(150)-t(i))];
    for j = 2:149
    y(j) = y(j-1) + x(j);

    for m = 1:149
    q(m)= 41904.076*y(m);
    t_1 = t(1:end-1);
    plot (t_1,q)
    grid on

    the number 41904.076 is the value of the constant...

    I dont know what is wrong with the code but i am not getting the result i should be getting... any suggestions ??

    Thanks in advance....
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted

Similar Discussions: Matlab for summation
  1. Matlab @ (Replies: 1)

  2. Summation question (Replies: 3)

  3. Summation Verification (Replies: 6)