Stand alone application run in cmd with multiple inputs

10 visualizzazioni (ultimi 30 giorni)
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?

Risposte (0)

Categorie

Scopri di più su MATLAB Compiler in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by