Matlab file converted into standalone application and given input arguments
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2013-1-21
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 个评论
Walter Roberson
2013-1-21
The code I showed above would not need any change: just type four values on the command line.
更多回答(1 个)
Image Analyst
2013-1-21
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!