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

Antworten (1)

Image Analyst
Image Analyst am 17 Mär. 2016

0 Stimmen

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 Kommentare

Jean-Claude
Jean-Claude am 17 Mär. 2016
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
Image Analyst
Image Analyst am 17 Mär. 2016
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.
Jean-Claude
Jean-Claude am 17 Mär. 2016
It opens the area function that it is supposed to use, i.e.,
\specgraph\area.m
Steven Lord
Steven Lord am 17 Mär. 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.
Image Analyst
Image Analyst am 17 Mär. 2016
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 17 Mär. 2016

Kommentiert:

am 17 Mär. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by