필터 지우기
필터 지우기

Matlab file converted into standalone application and given input arguments

조회 수: 4 (최근 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
Jian Dong
Jian Dong 2013년 1월 21일
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 2013년 1월 21일
편집: Walter Roberson 2013년 1월 21일
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])

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
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
Walter Roberson 2013년 1월 21일
The code I showed above would not need any change: just type four values on the command line.
Jian Dong
Jian Dong 2013년 1월 21일
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

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
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.

카테고리

Help CenterFile Exchange에서 Data Clustering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by