필터 지우기
필터 지우기

Separating arguments by line break

조회 수: 30 (최근 30일)
Steeven
Steeven 2018년 2월 8일
편집: Steeven 2018년 2월 8일
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
Stephen23
Stephen23 2018년 2월 8일
Did you try it? What happened?
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에서 Scope Variables and Generate Names에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by