Info

This question is closed. Reopen it to edit or answer.

Problem converting standanlone code

1 view (last 30 days)
Marco
Marco on 3 Dec 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi, I'm trying to compile this very simple program:
function [ out ] = prova(a, b )
disp(a)
disp(b)
c=a+b;
disp(c)
out=0;
end
When I run it in the matlab console - all fine there. If I compile the code and run the program, what I get, for example giving 2 and 3 as inputs, is
2
3
101
It is getting the right inputs, but whenever I try to compute an operation with those numbers the program uses the acii codes corresponding to the numbers. I'd really appreciate it if somebody can give me a hint. Thanks.

Answers (2)

Walter Roberson
Walter Roberson on 3 Dec 2013
Values you give on the command line of the executable are treated as strings. You are seeing '2' + '3' rather than 2 + 3

Marco
Marco on 3 Dec 2013
And how can I give numbers instead of strings? Thanks

Tags

Community Treasure Hunt

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

Start Hunting!