Results 1 to 3 of 3

Math Help - matlab code error

  1. #1
    Newbie
    Joined
    Sep 2013
    From
    beirut
    Posts
    19

    matlab code error

    Matlab code
    can you plz fix my error
    code:

    L=1;
    T_inf=30;
    qA=500;
    c=5;
    qB=c.*qA;
    h=25;
    dx=L/2;
    dy=L/4;
    kB=50;
    syms T1 T2 T4 T5 T7 T8
    for i=0:10:20
    kA=i;
    [sT1,sT2,sT4,sT5,sT7,sT8]=solve(T1*((h/dy)+(kA/dx^2)+(kA/dy^2))-T2*(kA/dx^2)-T4*(kA/dy^2)-(qA+h*T_inf)/dy,...
    T2*((h/dy)+(kA/dx^2)+(kA/dy^2))-T1*(kA/dx^2)-T5*(kA/dy^2)-(qA+h*T_inf)/dy,...
    T1*(-kA/dy^2)+T4*(((kA+kB)/dx^2)+(kA+kB)/dy^2)-T5*((kA+kB)/dx^2)-T7*(kB/dy^2),...
    T2*(-kA/dy^2)-T4*((kA+kB)/dx^2)+T5*(((kA+kB)/dx^2)+(kA+kB)/dy^2)-T8*(kB/dy^2),...
    T4*(-kB/dy^2)+T7*((h/dy)+(kB/dx^2)+(kB/dy^2))-T8*(kB/dx^2)-(qB+h*T_inf)/dy,...
    T5*(-kB/dy^2)-T7*(kB/dx^2)+T8*((h/dy)+(kB/dx^2)+(kB/dy^2))-(qB+h*T_inf)/dy);
    T_1(i)=sT1; T_2(i)=sT2; T_4(i)=sT4; T_5(i)=sT5; T_7(i)=sT7; T_8(i)=sT8;
    end
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member Rebesques's Avatar
    Joined
    Jul 2005
    From
    At my house.
    Posts
    538
    Thanks
    11

    Re: matlab code error

    The index i in T_1(i),T_2(i) etc must be a positive integer. So go to the for loop, and...
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Sep 2013
    From
    beirut
    Posts
    19

    Re: matlab code error

    i changed the for loop ==> for i= 1:10:20 and the error goes
    but still one problem in the line before the end showing me warning
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab error in my code
    Posted in the Advanced Math Topics Forum
    Replies: 1
    Last Post: January 19th 2014, 07:10 AM
  2. The [5,2] error correcting code
    Posted in the Number Theory Forum
    Replies: 3
    Last Post: July 25th 2010, 08:03 AM
  3. error correcting code
    Posted in the Advanced Math Topics Forum
    Replies: 5
    Last Post: February 19th 2010, 02:37 AM
  4. Error Correcting Code
    Posted in the Advanced Math Topics Forum
    Replies: 0
    Last Post: January 25th 2010, 07:44 PM
  5. Replies: 1
    Last Post: December 10th 2009, 10:48 PM

Search Tags


/mathhelpforum @mathhelpforum