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

답변 (1개)

Image Analyst
Image Analyst 2016년 3월 17일

0 개 추천

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

Jean-Claude
Jean-Claude 2016년 3월 17일
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 2016년 3월 17일
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 2016년 3월 17일
It opens the area function that it is supposed to use, i.e.,
\specgraph\area.m
Steven Lord
Steven Lord 2016년 3월 17일
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 2016년 3월 17일
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2016년 3월 17일

댓글:

2016년 3월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by