"XXX" requires more input arguments to run

27 次查看(过去 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
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
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:
  1. What version of MATLAB are you using?
  2. What operating system (be as specific as you can; if it's Linux, what distro and what version?)
  3. If it's Linux, what window manager are you using?
  4. Provide a function that when you try to run it from the editor causes this behavior.
  5. If there are any variables defined in the base workspace, indicate if you can reproduce this behavior without them being open.

请先登录,再进行评论。

采纳的回答

Image Analyst
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.
  1 个评论
Martin
Martin 2013-9-13
The windows is all yellow, and there is no X or push button on it. I'll try the CTRL shift esc thing next time it occurs. We'll see! :)

请先登录,再进行评论。

更多回答(10 个)

Jan
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?
  1 个评论
Martin
Martin 2013-9-12
Yes, I mean that I cannot close the window which contains this message. I run R2013a 64 bit on Windows 7.

请先登录,再进行评论。


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

Gorka
Gorka 2013-10-4
I have the same problem, do you know how to solve it ?

jalpa vasani
jalpa vasani 2013-10-16
how did you solve this problem? I am facing same one for factorial program!
  2 个评论
Image Analyst
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
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
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.

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

Wesley Ooms
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

Christine
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.
  1 个评论
Martin
Martin 2014-4-2
Thanks, I had forgotten this post but your message could be really useful. :)

请先登录,再进行评论。


Eric
Eric 2014-6-13
bump... same issue

Heinz
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 !!!

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by