area() not working

Hi, The in-build matlab function area() stopped working. I tried to run the example from the documentation:
Y = [1, 5, 3;
3, 2, 7;
1, 5, 3;
2, 6, 1];
figure
area(Y)
but I would get the error message
Error using area (line 35)
Too many input arguments.
I also tried to restart Matlab, as well as my PC. I am using 8.5.0.197613 (R2015a).
Regards, JC

Answers (1)

You didn't call your script area.m, did you? If so, name it something else because that would destroy the built-in area() function. What does this say:
which -all area

5 Comments

C:\Program Files (x86)\MATLAB\MATLAB Production Server\R2015a\toolbox\matlab\specgraph\area.m
C:\Program Files (x86)\MATLAB\MATLAB Production Server\R2015a\toolbox\matlab\polyfun\@alphaShape\area.m % alphaShape method
I previously only tried
which area
which would only get me the first path.
How do I disable the second one ?
Thanks in advance
When you hit that line in the debugger, type F11 (step into) and see which one you actually go into.
There is a rmpath() function but I'd be very leery about removing toolbox folders from your path.
It opens the area function that it is supposed to use, i.e.,
\specgraph\area.m
Steven Lord
Steven Lord on 17 Mar 2016
Don't remove the polyfun directory from your path. That overload of AREA for alphaShape objects will only be called if one of the inputs is an alphaShape object; it won't be executed otherwise. It won't interfere with a standard AREA call with one numeric array as input.
From the WHICH output it looks like this is running on MATLAB Production Server, correct? I'm not as familiar with that product as I am with MATLAB so I'm not sure what's causing this error. You may want to contact Technical Support and have them help you determine the cause of this problem.
Please give us the complete error message - ALL the red text, including the line number and line of code that was actually run. I just want to see what it thinks you called because I can't see how it can claim one input argument is too many. Though, if you have a maintenance/support contract (like if you bought the product within the last year or have a trial version), I'd definitely call them.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 17 Mar 2016

Commented:

on 17 Mar 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!