필터 지우기
필터 지우기

Application Compiler Syntax in Windows Command Prompt

조회 수: 1 (최근 30일)
wYw
wYw 2021년 10월 1일
댓글: Walter Roberson 2021년 10월 1일
Hi,
I'm using Application Compiler to create a standalone program.
The program I'm trying to pack is
function main(argsin)
if ischar(argsin)
argsin = eval(argsin);
end
[A,B,C]=argsin{:};
processprogram(A,B,C);
end
The idea is to input a series of char including directory, filename and etc. "processprogram" takes these inputs for process. For example, I could run main({'apple.txt','banana','peach'}) in the Matlab Command Window.
Could you please tell me what's the correct syntax in Windows Command Prompt? main apple.txt banana peach ?? I tried many format but couldn't get it right
Thank you

답변 (1개)

Walter Roberson
Walter Roberson 2021년 10월 1일
See varargin special name. It will be a cell array of character vectors
However I don't think you can use eval() in compiled apps.
  댓글 수: 2
wYw
wYw 2021년 10월 1일
Hi, thank you for the reply. You're right, argsin is a cell string array.
In this case, could you please tell me what's the correct syntax for Windows Command Prompt?
Thank you
Walter Roberson
Walter Roberson 2021년 10월 1일
function main(varargin)
assert(nargin == 3)
[A,B,C] = varargin{:};
processprogram(A,B,C);
end
and invoke it with
main apple.txt banana peach

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

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by