Separating arguments by line break

33 次查看(过去 30 天)
When writing a function with arguments, can the arguments be separated by a line break in some way (in the same way that they can be separated by whitespace characters such as space or tabulator indentation? And example is to go from the code line
choice = inputdlg(prompt,dlg_title,num_lines,defaultans);
to the (non-working) lines
choice = inputdlg(
prompt,
dlg_title,
num_lines,
defaultans
);
The error shown in this particular case is (it starts at line 9):
Error: File: MultipleDataFiles.m Line: 9 Column: 19
Expression or statement is incorrect--possibly unbalanced (, {, or [.
  2 个评论
Steeven
Steeven 2018-2-8
编辑:Steeven 2018-2-8
@StephenCobeldick Yes, it gives an error. See the update.

请先登录,再进行评论。

采纳的回答

Stephen23
Stephen23 2018-2-8
编辑:Stephen23 2018-2-8
Adding ellipses might help you:
choice = inputdlg(...
prompt,...
dlg_title,...
num_lines,...
defaultans);

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by