"XXX" requires more input arguments to run
조회 수: 20 (최근 30일)
이전 댓글 표시
Hi,
I have this message error when I accidentally pressed F5 on a child function. This is totally normal but I can't suppress this message, and it stays in front of the editor! Do you know how to remove this?
Thanks!
댓글 수: 7
D. Speller
2015년 8월 24일
The box in the screenshot above has persisted for several days (I just really don't want to restart my Matlab session...)
Steven Lord
2016년 7월 1일
I have again tried to reproduce this but been unable to do so. I pasted each section of the code from Heinz's answer into the Editor, saved it, and clicked on the green arrow. I received errors in the Command Window for the second of the third functions, but no error for the first or third and no "blue box" / window / message for any of the three cases.
If you can consistently or even occasionally reproduce this behavior, please contact Technical Support with those reproduction steps. Useful additional information to include:
- What version of MATLAB are you using?
- What operating system (be as specific as you can; if it's Linux, what distro and what version?)
- If it's Linux, what window manager are you using?
- Provide a function that when you try to run it from the editor causes this behavior.
- If there are any variables defined in the base workspace, indicate if you can reproduce this behavior without them being open.
채택된 답변
Image Analyst
2013년 9월 12일
Is there any kind of push button on it? Or does it have a white X on a red box in the upper right corner that you can click? Otherwise type Ctrl-shift-Esc, find the process and end it.
추가 답변 (10개)
Jan
2013년 9월 12일
It is clear, that you cannot suppress this message, because it is an important error message. Do you mean that you cannot close the window which contains this message? If so, which OS and Matlab version are you running?
David H
2015년 7월 2일
All these answers are basically "give the function default parameters" which is not always a desirable solution. If I accidently hit f5 I'd rather it didn't overwrite any variables in my work space, even ans. Mathsworks really needs to fix this bug, 2 years is quite unacceptable.
댓글 수: 0
jalpa vasani
2013년 10월 16일
how did you solve this problem? I am facing same one for factorial program!
댓글 수: 2
Image Analyst
2013년 10월 16일
I don't understand how you can't get rid of the error message and it just stays on top in front of the editor. Are you saying there is no way to close it, either with some kind of button that says "OK" or "Close", or by clicking the white X on the red box in the upper right corner of the error message? So you have the same problem as Martin - a yellow warning message box with no title bar and no buttons? Please capture a screenshot and attach it here with the image or paper clip icon.
D. Speller
2016년 7월 1일
A copy of my comment above, in case someone sees this and can help: I have had the same problem on Linux, with repeatability. What is required is to 1. Create a function with required input parameters; and 2. Click the green arrow labeled "Run" in the Editor tab of the script editor. I usually run into this when I have been using the command window or a wrapper script to run the function repeatedly for different values of the input parameters, but still have the function open. If the script is, for some reason, in the forefront (for example, after minor editing), and I accidentally run it directly with "Run" instead of from the command line or the wrapper script, a blue box with the note regarding additional required inputs appears and does not go away.
Wooseok
2013년 11월 20일
The same problem here. As a correction to this question, it's not a 'window', but it's just a yellow balloon message that appears on top of the editor window and never disappears. Because it is not a window, there is neither "OK" nor "Close" button. Also, it is not an independent process so it doesn't appear in the task manager. So, there is really no way to get rid of it but closing and restarting Matlab.
댓글 수: 0
Dakkaron
2013년 12월 7일
편집: Dakkaron
2013년 12월 7일
I have this problem as well. I am running Matlab R2012b on Windows 7 64 bit.
The problem occurs when you try to run a script file that contains a function without specifying the parameters of the function (so when you hit the "Run"-button in the script editor). The message itself isn't wrong at all. The problem is just that you can't get rid of it without closing the window. I attached a screenshot of the error. Though it belongs to the script editor (left window) it shows up right of the editor thus covering about a quarter of the console window which is extremely annoying especially if you suffer from a bit of OCD ;)
The only solution I found so far is closing the script editor (not the console window) and reopening it, which is a right pain if you have a few files open.
댓글 수: 0
Wesley Ooms
2014년 3월 28일
편집: Wesley Ooms
2014년 3월 31일
Same problem here. If f5 / f9 is a reflex, then you end up with 20 balloons per minute.
I found a solution for my case.
If it happens because you have the variable in your base workspace, you should save the file and type the filename with arguments in the command window like this:
file:
function do_stuf(input)
do stuff
end
command window:
do_stuf(input)
however since the reflex is so powerfull, you can write this in your function
function do_stuf%(input)
evalin('base','assignin(''caller'',''input'',input)')
do stuff
end
and the balloon will never pop up anymore
댓글 수: 0
Christine
2014년 4월 1일
I had the same problem and found this way to make the yellow box disappear:
If Matlab complains "dummy_function(input1, input2) requires more input arguments...." you press the small, black, downward facing arrow called 'Run' below the actual big green arrow with the same function as f5 (After this confusing description I decided to attach a picture...). You will find two options:
Run: dummy_function
Run: type code to run
Right click on the first option and then 'edit' enables you to put some default parameters for input 1 and input 2. The yellow box disappears and will also not appear again. If you don't want to set those default parameters, just press enter and the yellow box disappears but will reappear when ever you use f5 or the large green arrow.
Heinz
2015년 10월 16일
편집: Heinz
2015년 10월 16일
I also have this problem and it is extremly annoying!
What works is:
function [ output_args ] = Untitled( m)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
A=1
end
What does Produce the Problem (correctly)
function [ output_args ] = Untitled( m)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
A=1
m^2
end
What does produce the Problem and should not !!!
function [ output_args ] = Untitled( m)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
if nargin == 0
m=13
end
A=1
m^2
end
But besides knowing why it appears, its extremely annoying, that the yellow boxes can not be closed. (Except by closing the editor.) This is clearly a bug.
At least it works from the command line without problem. But with every F9 there is yellow box with "always on Top" Propertiy. And because it covers some of the ribbon, you have to move the editor, and every time the new yellow box hides a little more of your screen.
PLEASE SOLVE THIS !!!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!