1. 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?

2.

3. The error seems self explanatory. What exactly you need to know?

4. 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.

5. 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

6. 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

7. 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

 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   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement