Difference between revisions of "Program Examples:Sci Lab interface/zh-hans"
(Created page with "{{Languages}} Example for function of reading softMC record file from SciLab (64bit). <syntaxhighlight lang="scilab"> global rec rec = []; function MCplot(name) global rec...") |
|||
Line 1: | Line 1: | ||
− | {{Languages}} | + | {{Languages|Program_Examples:Sci_Lab_interface}} |
− | + | 从SciLab(64位)读取softMC记录文件的功能示例。 | |
− | |||
<syntaxhighlight lang="scilab"> | <syntaxhighlight lang="scilab"> | ||
Line 29: | Line 28: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * | + | * 32位版本是相同的,而是在'''''mget'''''中将"i"标识符替换为"l"标识符使用。 |
− | + | 该函数被调用为(绘制3D轨迹) : | |
<syntaxhighlight lang="vb"> | <syntaxhighlight lang="vb"> |
Latest revision as of 07:34, 17 July 2017
语言: | English • 中文(简体) |
---|
从SciLab(64位)读取softMC记录文件的功能示例。
global rec
rec = [];
function MCplot(name)
global rec
fid = mopen(name,'rb');
n = mget(1,'i',fid);
m = mget(1,'i',fid);
gap = mget(1,'i',fid);
vlen= mget(1,'i',fid);
var = mgetstr(vlen,fid);
n = modulo(n,16);
rec = zeros(m,n);
for i = 1:m
for j = 1:n
tmp = mget(1,'d',fid);
rec(i,j) = tmp;
end
end
mclose(fid);
endfunction
- 32位版本是相同的,而是在mget中将"i"标识符替换为"l"标识符使用。
该函数被调用为(绘制3D轨迹) :
MCplot('C:\SoftMC\Projects\test.rec')
parm3d(rec(:,1),rec(:,2),rec(:,3));