Notices
Results 1 to 6 of 6

Thread: Matlab

  1. #1 Matlab 
    Forum Masters Degree thyristor's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    542
    Hi!
    I've just started using Matlab, but already encountered a problem. If I write something like "y=x^2" or "y=x^x", Matlab says "??? Error using ==> mpower
    Inputs must be a scalar and a square matrix.". How do I get around this problem?


    373 13231-mbm-13231 373
    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Masters Degree Twit of wit's Avatar
    Join Date
    Jan 2010
    Posts
    553
    The error seems self explanatory. What exactly you need to know?


    Reply With Quote  
     

  4. #3  
    Forum Masters Degree thyristor's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    542
    So, is it not possible to treat polynomials, like in the case of x^2, in a program like Matlab? What I want to know is how to make the input so that the program can handle it.
    373 13231-mbm-13231 373
    Reply With Quote  
     

  5. #4  
    Forum Freshman seoexon's Avatar
    Join Date
    Jul 2010
    Location
    London
    Posts
    18
    Hey, why don't you check there own website for the solution Mathworks.com, I am sure you will find all your solutions there
    http://www.mathworks.com/

    I have just found something, i hope this would be helpful

    http://www.system.nada.kth.se/unix/s...ref/power.html
    Reply With Quote  
     

  6. #5  
    Forum Freshman
    Join Date
    Aug 2010
    Location
    Santa Fe, NM
    Posts
    5
    That's not how you define a function in Matlab.

    Matlab is a programming language -- you have to treat it like one, no just like writing math.

    The expression y=x^2 expects x to have been assigned a value already. It returns a number, it does not define a function y.

    Look up function definitions -- that's what you're looking for, methinks.

    Siggy
    Reply With Quote  
     

  7. #6  
    Forum Freshman hero_hont's Avatar
    Join Date
    Aug 2010
    Location
    sfsgfg
    Posts
    5
    Quote Originally Posted by SigmaX
    That's not how you define a function in Matlab.

    Matlab is a programming language -- you have to treat it like one, no just like writing math.

    The expression y=x^2 expects x to have been assigned a value already. It returns a number, it does not define a function y.

    Look up function definitions -- that's what you're looking for, methinks.

    Siggy
    hiih guys.
    I idea with SigmaX
    The MATLAB is a programming language processing signal and control in iindustrial had writed by language C, C++, and Fortran.
    we can get GUI in the matlab:axes, table,...
    The Matlab is sorfware good, help very much in our study.
    --------------
    Vietnam Travel, Vietnam tours-Vietnam beaches- Saigon hotels & restaurants
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •