Stand alone application run in cmd with multiple inputs

조회 수: 4 (최근 30일)
Petter Cedell
Petter Cedell 2020년 10월 28일
Hi,
I want to move a multiple input function to a standalone application, doing this via the application compiler and want to test the .exe in the cmd.
The test code looks like the following:
function c = addme(a,b)
switch nargin
case 2
c = a + b
case 1
c = a + a
otherwise
c = 0
end
end
So after installing the runtime, and opening the correct repository in cmd, launching the "addme" function as: addme(1,2) I recieve an (1,5) array with the values: c = [80 98 88 100 82]. Not really the answer I was hoping for. Similar when writing "addme 1 2", recieve "c = 99" as output, in both cases it should be 3. Can anyone help me understand what I'm doing wrong, is it purely syntactically?

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by