Laboratories for Mathematics, Lifesciences, and Informatics
a> をテンプレートにして作成
開始行:
[[内部向け/Matlab]]
*Introduction of MATLAB [#c257637a]
*How to install (Short) [#u665d84f]
*How to install (Full) [#m2fbc845]
*Setting the library path [#pbc57d3f]
You need to configure the library path to use MATLAB com...
Open ".bashrc" and add the following description.
export MATLABROOT=/usr/local/MATLAB/R2015a/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MATLABROOT/bin/...
*Remote connection [#jfcf0f7e]
*MATLAB compiler [#jb1b6760]
In this section how to compile and execute M-file on "bla...
+download the following file and put it to the same direc...
((Instead of using mcompile.sh, you can call command in M...
#ref(mcompile.sh)
+Log in to the blade you execute the calculation. You don...
+Execute the script by the following way.
$./mcompile.sh [M-filename without ".m"] [argument 1] [a...
-Advantage of MATLAB compiler
--You can execute calculations without using MATLAB licen...
--In some case the calculation becomes fast.
-Caution
--You can only compile "function M-file".
In case you are using "script M-file", add the following ...
function [M-filename without ".m"]
Then, define required variables in the M-file.
#br
---function M-file: Executed as function, in other words,...
---script M-file: Processing is described in order.
Variables are shared by before and after calculation.
--Use save/load command as a function setting down the ta...
--When you need arguments, modify the M-file as follows.
function hoge (a, b)
%Add the following description before other commands.
if (isdeployed)
a = str2num(a);
b = str2num(b);
end
%end
…
--You cannot draw "figure". As you cannot get return valu...
--When compiling is failed, proseccing is stopped by MATL...
Then, please end MATLAB in order to stop using the license
-sample source code (&ref(sample_func.m);)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sample code of Matlab compile (last update 2012/4/11)
%
% 1. compile (in Matlab):
% $mcc -m sample_func
%
% 2. execution example (in command terminal):
% $./sample_func 5 save_data.mat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function sample_func (num, savefile)
if(isdeployed)
num = str2num(num);
end
x=1;
for i = 1:num
x=x*i;
end
display(x);
save(savefile,'x');
return
終了行:
[[内部向け/Matlab]]
*Introduction of MATLAB [#c257637a]
*How to install (Short) [#u665d84f]
*How to install (Full) [#m2fbc845]
*Setting the library path [#pbc57d3f]
You need to configure the library path to use MATLAB com...
Open ".bashrc" and add the following description.
export MATLABROOT=/usr/local/MATLAB/R2015a/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MATLABROOT/bin/...
*Remote connection [#jfcf0f7e]
*MATLAB compiler [#jb1b6760]
In this section how to compile and execute M-file on "bla...
+download the following file and put it to the same direc...
((Instead of using mcompile.sh, you can call command in M...
#ref(mcompile.sh)
+Log in to the blade you execute the calculation. You don...
+Execute the script by the following way.
$./mcompile.sh [M-filename without ".m"] [argument 1] [a...
-Advantage of MATLAB compiler
--You can execute calculations without using MATLAB licen...
--In some case the calculation becomes fast.
-Caution
--You can only compile "function M-file".
In case you are using "script M-file", add the following ...
function [M-filename without ".m"]
Then, define required variables in the M-file.
#br
---function M-file: Executed as function, in other words,...
---script M-file: Processing is described in order.
Variables are shared by before and after calculation.
--Use save/load command as a function setting down the ta...
--When you need arguments, modify the M-file as follows.
function hoge (a, b)
%Add the following description before other commands.
if (isdeployed)
a = str2num(a);
b = str2num(b);
end
%end
…
--You cannot draw "figure". As you cannot get return valu...
--When compiling is failed, proseccing is stopped by MATL...
Then, please end MATLAB in order to stop using the license
-sample source code (&ref(sample_func.m);)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sample code of Matlab compile (last update 2012/4/11)
%
% 1. compile (in Matlab):
% $mcc -m sample_func
%
% 2. execution example (in command terminal):
% $./sample_func 5 save_data.mat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function sample_func (num, savefile)
if(isdeployed)
num = str2num(num);
end
x=1;
for i = 1:num
x=x*i;
end
display(x);
save(savefile,'x');
return
ページ名: