Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Math Help - Question in MATLAB

  1. #1
    Newbie
    Joined
    Dec 2011
    Posts
    13

    Question Question in MATLAB

    [IMG] [/IMG]
    could you please help me for this question?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: Question in MATLAB

    Quote Originally Posted by nezar View Post
    [IMG] [/IMG]
    could you please help me for this question?
    What ideas have you had so far?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2011
    Posts
    13

    Re: Question in MATLAB

    actually no
    Follow Math Help Forum on Facebook and Google+

  4. #4
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: Question in MATLAB

    I would probably start by defining a vector that contains the R_{L} values. How could you do that?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: Question in MATLAB

    Quote Originally Posted by nezar View Post
    actually no
    Why not this is not the first Matlab plot question you have asked?

    In fact I see no reason why you should have a problem with this since you have code to plot the other one.

    CB
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Dec 2011
    Posts
    13

    Re: Question in MATLAB

    i am sorry i am really try to get the answer ,but i don't get any thing
    rl=(1,10,1000);
    p=12^2.*rl/(rl+2.5)^2;
    plot(p);
    Follow Math Help Forum on Facebook and Google+

  7. #7
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: Question in MATLAB

    Quote Originally Posted by nezar View Post
    i am sorry i am really try to get the answer ,but i don't get any thing
    rl=(1,10,1000);
    p=12^2.*rl/(rl+2.5)^2;
    plot(p);
    I would modify your last line. What your current last line will do is plot p as a function of the index. But you really want to plot as a function of rl. Hence, I would do this:

    plot(rl,p)

    See what that does.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: Question in MATLAB

    Quote Originally Posted by nezar View Post
    i am sorry i am really try to get the answer ,but i don't get any thing
    rl=(1,10,1000);
    p=12^2.*rl/(rl+2.5)^2;
    plot(p);
    Have you tried typing any of this at the command line?

    CB
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Dec 2011
    Posts
    13

    Re: Question in MATLAB

    Quote Originally Posted by Ackbeet View Post
    I would modify your last line. What your current last line will do is plot p as a function of the index. But you really want to plot as a function of rl. Hence, I would do this:

    plot(rl,p)

    See what that does.
    i try but he gave me
    ??? Error: File: nezarn.m Line: 1 Column: 6
    Expression or statement is incorrect--possibly unbalanced (, {, or [.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: Question in MATLAB

    Quote Originally Posted by nezar View Post
    i try but he gave me
    ??? Error: File: nezarn.m Line: 1 Column: 6
    Expression or statement is incorrect--possibly unbalanced (, {, or [.
    I suspect your first line is not the correct syntax for defining a vector in MATLAB. You're after, apparently, a vector containing 1000 numbers ranging from 1 to 10. Try this expression instead:

    rl=1:0.009:10;
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Dec 2011
    Posts
    13

    Re: Question in MATLAB

    Quote Originally Posted by CaptainBlack View Post
    Have you tried typing any of this at the command line?

    CB
    no
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Newbie
    Joined
    Dec 2011
    Posts
    13

    Re: Question in MATLAB

    Quote Originally Posted by Ackbeet View Post
    I suspect your first line is not the correct syntax for defining a vector in MATLAB. You're after, apparently, a vector containing 1000 numbers ranging from 1 to 10. Try this expression instead:

    rl=1:0.009:10;
    error
    ??? Error using ==> mpower
    Matrix must be square.

    Error in ==> nezarn at 2
    p=12^2.*rl/(rl+2.5)^2;
    Follow Math Help Forum on Facebook and Google+

  13. #13
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: Question in MATLAB

    Quote Originally Posted by nezar View Post
    error
    ??? Error using ==> mpower
    Matrix must be square.

    Error in ==> nezarn at 2
    p=12^2.*rl/(rl+2.5)^2;
    Try using dots everywhere, since you're wanting component-wise arithmetic. That is, try

    p=12^2.*rl./(rl+2.5).^2;

    Note: you actually don't need a dot for the first one, because that's a scalar. So you could probably do

    p=12^2*rl./(rl+2.5).^2;
    Follow Math Help Forum on Facebook and Google+

  14. #14
    Newbie
    Joined
    Dec 2011
    Posts
    13

    Re: Question in MATLAB

    Quote Originally Posted by Ackbeet View Post
    Try using dots everywhere, since you're wanting component-wise arithmetic. That is, try

    p=12^2.*rl./(rl+2.5).^2;

    Note: you actually don't need a dot for the first one, because that's a scalar. So you could probably do

    p=12^2*rl./(rl+2.5).^2;
    yes i get the answer
    thank you for help me
    Follow Math Help Forum on Facebook and Google+

  15. #15
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: Question in MATLAB

    Quote Originally Posted by nezar View Post
    yes i get the answer
    thank you for help me
    So, in paying attention to CB's posts, let me ask you these questions:

    1. Do you know why you got the errors you got?
    2. Do you know how to fix them once you see them again?
    3. Do you see why MATLAB didn't like your previous syntax?
    4. Does your graph make sense?
    Follow Math Help Forum on Facebook and Google+

Page 1 of 2 12 LastLast

Similar Math Help Forum Discussions

  1. Question in matlab
    Posted in the Math Software Forum
    Replies: 5
    Last Post: January 8th 2011, 05:07 AM
  2. please help me with this MATLAB Question
    Posted in the Math Software Forum
    Replies: 0
    Last Post: April 16th 2010, 01:51 AM
  3. matlab question.need help :(
    Posted in the Math Software Forum
    Replies: 0
    Last Post: October 7th 2009, 07:58 AM
  4. Matlab Question Help
    Posted in the Math Software Forum
    Replies: 6
    Last Post: September 20th 2009, 10:57 PM
  5. Hello - Matlab question
    Posted in the Math Software Forum
    Replies: 1
    Last Post: May 3rd 2009, 11:59 PM

Search Tags


/mathhelpforum @mathhelpforum