필터 지우기
필터 지우기

Compiling Matlab Code: it works in Matlab but not when compiled.

조회 수: 3 (최근 30일)
Doriana
Doriana 2014년 5월 16일
댓글: Doriana 2014년 5월 19일
Hello all,
I have a program that use parallel toolbox. That works perfectly in Matlab but when I compile it and execute it, I get this error: Error using parpool. Allowed value for the second argument is an integer specifying the pool size.
the program crashes in this row:
parpool('local' ,poolsize);
To run the program outside matlab I insert as a parameter :
'poolsize' '2'
Thank you,
P.s i'm using matlab (2014a) and mcr 8.3 (2014a)

채택된 답변

Harsheel
Harsheel 2014년 5월 16일
Not sure how you're 'inserting' the parameter but seems like you're passing the arguments from command line. If so then, all arguments are passed in as characters. You need to convert it to integer and then pass it to parpool. Like:
if ischar(poolSize) %where poolSize stores the user input
poolSize=str2num(poolSize); %convert string to number
end
parpool('local',poolSize);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by