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

Error on mathlab, and I have no idea how to correct it, please help me out

  1. Feb 8, 2012 #1
    error on mathlab, and I have no idea how to correct it, please help me out :(

    Hello guys, I was using a class assignment using matlab, and the code is provided by the professor. All we need to do is use plug the function in and run it. But for some reason, I got this error:
    ??? Error using ==> mpower
    Inputs must be a scalar and a square matrix.

    Error in ==> @(x)(e^(cos(x))+8*x^2-3-x-4)^(1/5)


    Error in ==> fpi at 5
    x(i+1)=g(x(i));

    I dont see a problem in that, can someone point it out for me?
     
  2. jcsd
  3. Feb 8, 2012 #2

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

    Re: error on mathlab, and I have no idea how to correct it, please help me out :(

    try @(x)(e^(cos(x))+8*x.^2 -3-x-4).^(1/5)
     
  4. Feb 8, 2012 #3
    Re: error on mathlab, and I have no idea how to correct it, please help me out :(

    Thank you for your reply, I found the answer. Seems like in matlab, there is no "e", have to use exp() instead.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Error on mathlab, and I have no idea how to correct it, please help me out
Loading...