📄 nefsim1.m
字号:
function nefsim1(action, loopdir);
%NEFSIM1 Displays selected simulation result.
% The embedded NEFCON matrix can be extracted to a .nef file.
%
% See also NEFSIM and NEFCON.
% Author: Andreas Nuernberger, TU Braunschweig, August 1996; a.nuernberger@tu-bs.de
% contact: Ludger Merz, DASA-Airbus GmbH, Hamburg; ludger.merz@airbus.de
% ----------------------------------------------------------------
% Einlesen der Parameter
% ----------------------------------------------------------------
global NEFCON_CYC NEFCON_FIS NEFCON_ACTCYC NEFCON_STOP NEFCON_STAT NEFCON_NOISE
if nargin == 0
action = '';
end
ldir = 'loop/';
if nargin == 2
if loopdir ~= []
ldir = loopdir;
end
end
if strcmp(action, 'wbd'),
%-----------------------------------------------
% select a spezial subplot with the mouse and
% plot the new figure
%-----------------------------------------------
global button;
h = get(gca, 'Children');
x_spe = get(h(1), 'Xdata');
y_spe = get(h(1), 'Ydata');
if length(h) >= 2,
z_spe = get(h(2), 'Ydata');
v = axis;
else,
z_spe = [];
end;
h1 = get(gca, 'Title');
title_spe = get(h1, 'String');
h1 = get(0, 'Children');
figure(length(h1)+2);
if length(h) >= 2,
diff = abs(z_spe-y_spe);
% fill([x_spe x_spe(length(x_spe))],[diff+v(3)*ones(size(diff)) v(3)],'g'),
fill([x_spe v(2) v(1)],[diff+v(3)*ones(size(diff)) v(3) v(3)],'g'),
hd = get(gca, 'children');
set(hd, 'FaceColor', [0.7 0.7 0.7]);
axis(v);
hold on,
plot([v(1),v(2),v(2), v(1), v(1)], [v(3),v(3),v(4), v(4), v(3)], 'w');
we = uicontrol(gcf, 'style','pushbutton',...
'position',[15 3 100 18],...
'Callback', ['nefsim1(''btn'',''' ldir ''');'],...
'string', 'Save system');
cl = uicontrol(gcf, 'style','pushbutton',...
'position',[150 3 100 18],...
'Callback', 'close(gcf);',...
'string', 'Close');
end;
if z_spe == [],
plot(x_spe, y_spe, 'm');
else,
plot(x_spe, z_spe, 'm', x_spe, y_spe, 'c');
end;
grid,
title(title_spe);
hold off,
zoom;
elseif strcmp(action, 'btn'),
%-----------------------------------------------
% load selected system and save it
%-----------------------------------------------
h1 = get(gca, 'Title');
loopf = get(h1, 'String');
[fn, path] = uiputfile ('*.nef', 'Save Nefcon settings');
if fn ~= 0
cmd = ['load ' ldir loopf '; save ' [path fn] ' nefsmat;'];
eval(cmd);
end
else
disp('Illegal usage of nefsim1.');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -