Matlab file converted into standalone application and given input arguments

7 views (last 30 days)
Hi I have converted a Matlab program into standalone program .exe. when I run .exe file in windows command prompt it return the following error
1. two many input arguments // when I give two inputs which is supposed to be 2. the first argument should have as many column as input variables as many rows as independent set of input values // when I give one input.
I used the command to build standalone : "mcc -mv myfile.m -a datfile.fis" ----------- building process is ok. But when I run with this command " myfile.exe 2.0 20.2 "in windows prompt it gives above errors. My program takes two inputs and gives one output. I have run Matlab tutorial magicsquare.m to convert magicsquare.exe on the same computer and works fine
  4 Comments
Jian Dong
Jian Dong on 21 Jan 2013
I type the following command on windows command prompt
c:\>myfile.exe 2.0 20.2 // I am supposed to give two inputs in double such as 2.0 and 20.2 assume myfile.exe is in my root directory
Jian Dong
Jian Dong on 21 Jan 2013
Edited: Walter Roberson on 21 Jan 2013
I am not using GUIDE. My code as follows
function out = myfile (x); % get two inputs in double
fismat =readfis('myfile.fis'); % read fuzzy file
out=evalfis (x,fismat); % result after defuzzificztion ----- In matlab I am given input in the following format and it is working fine------- myfile([2.0 20.2])

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 21 Jan 2013
Arguments passed to a compiled executable are in character format. If you need numeric values, convert the inputs to numeric.
Also, spaces normally mark the end of each argument, so if you want 2.0 20.2 to be a single vector, you need to expect multiple inputs and convert the inputs into a numeric vector.
  10 Comments
Walter Roberson
Walter Roberson on 21 Jan 2013
The code I showed above would not need any change: just type four values on the command line.
Jian Dong
Jian Dong on 21 Jan 2013
That's great. Thanks you very much for your help. I think you are the right person I can discuss one more thing. I have developed one fuzzy model in Matlab and converted into Java package through Matlab Java builder JA. but when I run this converted fuzzy model with my other java module . It takes unbelievable memory. I have run this model on high performance machine with 400 GB RAM but still get memory allocation problem. That's why I am trying to run now with standalone application. what do you think If I run standalone fuzzy model with my other java module in java, will it takes same amount of memory? Please help in this regard

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 21 Jan 2013
Try it this way
function out = myfile(varargin) % get two inputs in double
x = str2double(deal(varargin))
% Now use x as an array in the rest of your function.

Categories

Find more on Data Clustering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!