Stand alone application run in cmd with multiple inputs

4 visualizaciones (últimos 30 días)
Petter Cedell
Petter Cedell el 28 de Oct. de 2020
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?

Respuestas (0)

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by