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 Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by