Results 1 to 3 of 3

Math Help - wrong code at matlab - meshgrid and 3d plot

  1. #1
    Newbie
    Joined
    Jun 2009
    Posts
    4

    wrong code at matlab - meshgrid and 3d plot

    hi all ,
    got a problem with my code and i'm using matlab.

    T0=11;
    x =-60:.1:60;
    y=-60:.1:60;

    [X,Y]=meshgrid(x,y);
    S=(X)+(Y.*j);
    H=(T0./(S.^2))*(exp(S./T0)+exp(-S./T0)-2);
    surf (X, Y , abs(H));

    the problam is that it gives me a graph that is black! no colors... and i know that the default is random colors but i get only black from some reason.
    the other problem is that i suppose to write y=-100:0.1:100; and not -60:0.1:60; but it will not work if i try value 100. i have no idea how to fix it
    Last edited by winterelf; June 29th 2009 at 01:28 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by winterelf View Post
    hi all ,
    got a problem with my code and i'm using matlab.

    T0=11;
    x =-60:.1:60;
    y=-60:.1:60;

    [X,Y]=meshgrid(x,y);
    S=(X)+(Y.*j);
    H=(T0./(S.^2))*(exp(S./T0)+exp(-S./T0)-2);
    surf (X, Y , abs(H));

    the problam is that it gives me a graph that is black! no colors... and i know that the default is random colors but i get only black from some reason.
    the other problem is that i suppose to write y=-100:0.1:100; and not -60:0.1:60; but it will not work if i try value 100. i have no idea how to fix it
    Try it with a much sparser grid.

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jun 2009
    Posts
    4
    thanks, i found the prolem
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. 3D plot of z = (Matlab)
    Posted in the Math Software Forum
    Replies: 4
    Last Post: July 14th 2011, 08:22 PM
  2. What's wrong in this code ?
    Posted in the Math Software Forum
    Replies: 2
    Last Post: March 19th 2010, 04:00 AM
  3. Something is wrong with my code
    Posted in the Math Software Forum
    Replies: 1
    Last Post: June 27th 2009, 09:37 PM
  4. MatLab Plot
    Posted in the Math Software Forum
    Replies: 1
    Last Post: August 2nd 2008, 10:59 AM
  5. What is wrong with this code?
    Posted in the LaTeX Help Forum
    Replies: 4
    Last Post: March 7th 2008, 02:54 AM

Search Tags


/mathhelpforum @mathhelpforum