代码拉取完成,页面将自动刷新
% PSINS Toolbox initialization.
% See also glvs.
% Copyright(c) 2009-2014, by Gongmin Yan, All rights reserved.
% Northwestern Polytechnical University, Xi An, P.R.China
% 09/09/2013, 31/01/2015
initfile = dir('psinsinit.m');
if isempty(initfile) % ~strcmp(initfile.name,'psinsinit.m')
% error('Please set the current working directory to PSINS.');
uiwait(warndlg('Initialization failure!!! Please set Matlab current working directory to PSINS.','PSINS','modal'));
return;
end
%% Remove old PSINS path from search path.
pp = [';',path,';'];
kpsins = strfind(pp, 'psins');
ksemicolon = strfind(pp, ';');
krm = length(kpsins);
for k=1:krm
k1 = find(ksemicolon<kpsins(k),1,'last');
k2 = find(kpsins(k)<ksemicolon,1,'first');
pk = pp(ksemicolon(k1)+1:ksemicolon(k2)-1);
rmpath(pk);
end
%% Add new PSINS directories to search path.
rootpath = pwd;
pp = genpath(rootpath);
mytestflag = 0;
if exist('mytest\mytestinit.m', 'file')
mytestflag = 1;
end
datapath = [rootpath, '\data\'];
if isempty(find(rootpath=='\',1)) % for Unix
rootpath(rootpath=='\')='/';
datapath(datapath=='\')='/';
pp(pp=='\')='/';
end
addpath(pp);
res = savepath; % disp(res);
%% Create PSINS environment file
fid = fopen('psinsenvi.m', 'wt');
fprintf(fid, 'function [rpath, dpath, mytestflag] = psinsenvi()\n');
fprintf(fid, '\trpath = ''%s'';\n', rootpath);
fprintf(fid, '\tdpath = ''%s'';\n', datapath);
fprintf(fid, '\tmytestflag = %d;\n', mytestflag);
fclose(fid);
clear pp rootpath datapath res fid mytestflag;
glvs;
% disp(' *** PSINS Toolbox Initialization Done! ***');
uiwait(msgbox(' PSINS Toolbox Initialization Done! ','PSINS','modal'));
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。