亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? eyesampl.m

?? 3G源碼Mfiles有很詳實的內容哦適合3g初學者
?? M
?? 第 1 頁 / 共 2 頁
字號:
function  [sys, x0, str, ts]  = eyesampl(t,x,u,flag,...
    timeRange, boundary, storeLength, eyeLine, scatterLine, sampleTime)
% EYESAMPL Simulink eye diagram and scatter plot --- sampled time version.
%   [SYS, X0, STR, TS]  = EYESAMPL(T,X,U,FLAG,TIMERANGE,BOUNDARY,STORELENGTH,EYELINE,SCATTERLINE,SAMPLETIME)
%
%   This M-file is designed to be used in a Simulink S-function block.
%   It plots eyediagram against time and the scatter plot.
%   The parameter for the block of this figure are:
%
%   timeRange    Time range = [Digit Sample Time, Plot offset, Decision offset]
%   boundary     Lower and upper boundary of the Y axis.
%   storeLength  Keep number of traces in storage for print purpose.
%   eyeLine      Line type for eye-pattern diagram (0 for no such plot)
%   scatterLine  Symbol type for scatter plot (0 for no such plot)
%   sampleTime   [Update sample time, update offset]
%   
%   This file takes scalar input or 2 dimensional vector input
%
%   Set this M-file up in an S-function block.
%   Set the function parameter up as a four element vector
%   which defines the axis of the graph. The line type must be in
%   quotes.
%
%   See also PLOT, SFUNYST, SFUNXY, EYEDIASI

%       Copyright 1996-2001 The MathWorks, Inc.
%       $Revision: 1.27 $ $Date: 2001/04/05 04:38:01 $ 

switch flag,

  %%%%%%%%%%%%%%%%%%
  % Initialization %
  %%%%%%%%%%%%%%%%%%
  case 0,
  [sys,x0,ts] = mdlInitializeSizes(...
      timeRange, boundary, storeLength, eyeLine, scatterLine, sampleTime);
  SetBlockCallbacks(gcbh);
  
  %%%%%%%%%%
  % Update %
  %%%%%%%%%%
  case 2,
  sys = mdlUpdate(t,x,u,...
      timeRange, boundary, storeLength, eyeLine, scatterLine, sampleTime);
  
  %%%%%%%%%%%%%%%%%%%
  % Next Sample Hit %
  %%%%%%%%%%%%%%%%%%%
  case 4,
  sys = mdlGetTimeOfNextVarHit(t, x, u);  
  
  %%%%%%%%%%%%%%%%%%%
  % Unhandled flags %
  %%%%%%%%%%%%%%%%%%%
  case {1, 3, 9 }
    sys=[];

  %%%%%%%%%
  % Start %
  %%%%%%%%%
  case 'Start'
  LocalBlockStartFcn

  %%%%%%%%
  % Stop %
  %%%%%%%%
  case 'Stop'
  LocalBlockStopFcn

  %%%%%%%%%%%%%%
  % NameChange %
  %%%%%%%%%%%%%%
  case 'NameChange'
  LocalBlockNameChangeFcn
    
  %%%%%%%%%%%%%
  % Load,Copy %
  %%%%%%%%%%%%%
  case { 'LoadBlock', 'CopyBlock' }
  LocalBlockLoadCopyFcn
    
  %%%%%%%%%%%%%%%
  % DeleteBlock %
  %%%%%%%%%%%%%%%
  case 'DeleteBlock'
  LocalBlockDeleteFcn
    
  %%%%%%%%%%%%%%%%
  % DeleteFigure %
  %%%%%%%%%%%%%%%%
  case 'DeleteFigure'
  LocalFigureDeleteFcn

  %%%%%%%%%%%%%%%%%%%%
  % Unexpected flags %
  %%%%%%%%%%%%%%%%%%%%
  otherwise
  if ischar(flag),
    errmsg=sprintf('Unhandled flag: '' 	%s''', flag);
  else
    errmsg=sprintf('Unhandled flag: 	%d', flag);
  end
  
  error(errmsg);
  
end

% end eyesampl

%
%=============================================================================
% mdlInitializeSizes
% Return the sizes, initial conditions, and sample times for the S-function.
%=============================================================================
%
function [sys,x0,ts] = mdlInitializeSizes(...
	timeRange, boundary, storeLength, eyeLine, scatterLine, sampleTime);

%
% call simsizes for a sizes structure, fill it in and convert it to a sizes array.
%
sizes = simsizes;

sizes.NumContStates  = 0;
sizes.NumDiscStates  = 3;   % 3 discrete states
sizes.NumOutputs     = 0;
sizes.NumInputs      = -1;  % dynamically sized input vector
sizes.DirFeedthrough = 0;   % the meter does not have direct feedthrough
sizes.NumSampleTimes = 1;

sys = simsizes(sizes);

%
% initialize the initial condition
%
x0 = [0, 0, 0]; 			% figure handle, u[last] input, last_mod_time

% x(1), the figure handle.
if isempty(sampleTime)
  sampleTime = [-1 0];
end;
if length(sampleTime) < 2
  sampleTime(2) = 0;
end
ts = [sampleTime(1), sampleTime(2)];

%
% str is always an empty matrix
%
str = [];

% end mdlInitializeSizes

%
%============================================================================
% mdlGetTimeOfNextVarHit
% Return the time of the next hit for this block. Note that the result 
% is absolute time.
%============================================================================
%
function sys = mdlGetTimeOfNextVarHit(t, x, u);  

if sampleTime(1) > 0
  sys = t + sampleTime(1);
else
  sys = [];
end;

% end mdlGetTimeOfNextVarHit

%
%=============================================================================
% mdlUpdate
% Handle discrete state updates, sample time hits, and major time step
% requirements.
%=============================================================================
%
function sys = mdlUpdate(t,x,u,...
   timeRange, boundary, storeLength, eyeLine, scatterLine, sampleTime);

%
% Locate the figure window associated with this block. If it's not a valid
% handle (it may have been closed by the user), then return.
%
figureHandle = GetEyesamplFigure(gcbh);
if ~ishandle(figureHandle)
  return;
end;  

threshold = .2;
eye_plot = ~((eyeLine(1)==0) + (eyeLine(1)=='0'));
scatter_plot = ~((scatterLine(1)==0) + (scatterLine(1) == '0'));
len_u = length(u);

if scatter_plot & (len_u > 2)
  sl_name = get_param(0,'CurrentSystem'); 
  block = get_param(sl_name ,'CurrentBlock'); 
  error(['Please set scatter plot line type to be zero in block ', sl_name, '/', block]);
  if len_u > 2
    error('The input signal length should be no larger than two.')
  end;
end;

plot_type = eye_plot + scatter_plot;
% in case of no plot
if plot_type <= 0
  return;
end;

if length(timeRange) < 2
  timeRange(2) = 0;
else
  timeRange(2) = rem(rem(timeRange(2), timeRange(1)) + timeRange(1), timeRange(1));
end;

if length(timeRange) < 3
  timeRange(3) = timeRange(1)/2 + timeRange(2);
end;

% initialize the figure
if x(1) == 0
  h_fig = x(1);
  % Initialize graph
  sl_name = gcs;
  block = get_param(sl_name,'CurrentBlock'); 
  sl_name_gcs = sl_name;
  if ~isempty(find(sl_name=='/'))
    sl_name = sl_name(find(sl_name=='/')+1 : length(sl_name));
  end;    

  [n_b, m_b]= size(block);
  if n_b < 1
    error('Cannot delete block while simulating');
  elseif n_b > 1
    error('Something wrong in get_param, You don''t have the current Simulink')
  end;
  
  %  if new_figure | old_figure
  %  generate a new figure here.
  x(1) = figureHandle;
  if plot_type == 1
    %open a single window figure
    delete(allchild(x(1)));
    figurePosition = get(x(1),'Position');
    figurePosition(3) = 360;	
    set(x(1), ...
	'Visible','on',...
	'Position', figurePosition );	  
    plt(1) = axes('Unit','norm',...
	'Pos',[.08, .08 .87,.87],...
	'Clipping', 'on',...
	'Parent', x(1),...
	'NextPlot','Add' ,...
	'HandleVisibility', 'off');
  elseif plot_type == 2
    % open a double window figure
    delete(allchild(x(1)));
    figurePosition = get(x(1),'Position');
    figurePosition(3) = 660;	
    set(x(1), ...
	'Visible','on',...
	'Position', figurePosition );	  
    plt(1) = axes('Unit','norm',...
	'Pos',[.08, .08 .8/2,.87],...
	'Clipping', 'on',...
	'Parent', x(1),...
	'NextPlot','Add',...
	'HandleVisibility', 'Off');
    plt(2) = axes('Unit','norm',...
	'Pos',[.08+.5, .08 .8/2,.87],...
	'Parent', x(1),...
	'NextPlot','Add',...
	'HandleVisibility', 'Off');
  end;
  
  i = 1;
  if eye_plot
    eye_plot = plt(i);
    i = i+1;
    set(x(1),'CurrentAxes',eye_plot);
    ax = [];
    lines = eyeLine;
    for j = 1:len_u+1;
      [col, lines] = strtok(lines, '/');
      if length(col) <= 1
	col = 'k-';
      end;
      if lower(col(1)) == 'n'
	ax(j) = 0
      else
	[linest, markst] = LineTypeSeparation(col(2:length(col)));
	ax(j) = plot(0,0,col,...    
	    'Erasemode','none',...
	    'Color',col(1),...
	    'LineStyle',linest,...
	    'Marker', markst,...
	    'Parent', eye_plot);
	set(ax(j), 'XData', [], 'YData', []);
      end;
    end;
    
    set(eye_plot,...
	'Xlim',[rem(timeRange(2)/timeRange(1),1)...
	    *timeRange(1), timeRange(1)+timeRange(2)], ...
	'Ylim',[boundary(1), boundary(2)], 'Clipping', 'on');
    set(eye_plot,'UserData',[ax, 0  ]);
    %                        |   | |==>space for time points
    %                        |   |==> number of NaN added
    %                        |===> have size of length(u)
  end;
  if (scatter_plot)
    scatter_plot = plt(i);
    i = i + 1;
    set(x(1),'CurrentAxes',scatter_plot);
    ax = [];
    lines = scatterLine;
    for j = 1:len_u
      [col, lines] = strtok(lines, '/');
      if length(col) <= 1
	col = 'k-';
      end;
      if ((len_u == 2) & (j == 2))
	ax(j) = 0;
      else
	if lower(col(1)) == 'n'
	  ax(j) = 0
	else
	  [linest, markst] = LineTypeSeparation(col(2:length(col)));
	  ax(j) = plot(0,0,col,...
	      'Erasemode','none',...
	      'Color',col(1),...
	      'LineStyle',linest,...
	      'Marker', markst,...
	      'Parent', scatter_plot);
	  if col(2) == '.'
	    set(ax(j), 'MarkerSize', 10);
	  end;
	  set(ax(j), 'XData', [], 'YData', []);
	end;
      end;
    end;
    if len_u == 2
      set(scatter_plot,...
	  'Xlim',[boundary(1), boundary(2)], ...
	  'Ylim',[boundary(1), boundary(2)]);
    else
      set(scatter_plot,...
	  'Xlim',[-1, 1],...
	  'Ylim',[boundary(1), boundary(2)]);
    end;
    set(scatter_plot,'UserData',[ax, abs(scatterLine)]);
  end;
  set(x(1),'UserData',[eye_plot, scatter_plot, timeRange, boundary, abs(eyeLine)]);
  %                    1         2             3           6         8
  set_param(sl_name_gcs, 'userdata', x(1));
  %  end;
elseif x(1) < 0
  % figure has been closed.
  return;
end;

plot_flag_test = allchild(0);
if isempty(plot_flag_test)
  return;
elseif isempty(find(plot_flag_test == x(1)))
  x(1) = -1;
  return;
end;

handles = get(x(1), 'UserData');
len_u = length(u);
changed_boundary   = 0;
if max(boundary ~= handles(6:7)) > 0
  changed_boundary = 1;
end;

mod_time = rem((t - timeRange(2))/timeRange(1), 1) * timeRange(1) + timeRange(2);
triggered = 0;
if (mod_time >= timeRange(3)) & (x(2) < timeRange(3))
  triggered = 1;
end;
x(2) = mod_time;

if handles(1) & eye_plot
  %eye_pattern plot
  sub_han = get(handles(1),'UserData');
  changed_timeRange = 0;
  if max(timeRange ~= handles(3:5)) > 0
    changed_timeRange = 1;
  end;
  if changed_boundary
    set(handles(1), 'Ylim', boundary);
  end;
  if changed_timeRange
    %this is a complicated process. Deal it later.
  end;
  len_h_userdata = length(handles);
  changed_line_type = 0;
  if (length(eyeLine) ~= len_h_userdata-7)
    changed_line_type = 1;
  elseif max(abs(eyeLine) ~= handles(8:len_h_userdata))
    changed_line_type = 1;
  else
    changed_line_type = 0;
  end;
  if changed_line_type
    lines = eyeLine;
    for i = 1 : len_u+1
      [col, lines] = strtok(lines, '/');
      if length(col) <= 1
	col = 'k-';
      end;
      if sub_han(i)
	[linest, markst] = LineTypeSeparation(col(2:length(col)));
	set(sub_han(i), ...
	    'Color',col(1),...
	    'LineStyle',linest,...
	    'Marker', markst);
      end;
    end;
    set(x(1),'UserData',[handles(1:7), abs(eyeLine)]);
  end;
  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品免费| 91在线国产观看| 欧美不卡在线视频| 久久国产夜色精品鲁鲁99| 精品少妇一区二区三区在线播放 | 在线观看不卡一区| 一区二区三区四区在线播放| 欧美性色黄大片| 天使萌一区二区三区免费观看| 欧美高清你懂得| 国产一区二区三区四区五区美女| 中文字幕国产一区| 欧洲色大大久久| 久草在线在线精品观看| 国产精品久久久久影视| 91蜜桃免费观看视频| 视频一区在线播放| 国产视频一区二区三区在线观看 | 亚洲成人免费av| 日韩精品一区二区三区老鸭窝| 久久国产精品第一页| 国产精品麻豆欧美日韩ww| 在线视频欧美精品| 国内外成人在线视频| 国产精品久久久久婷婷| 欧美巨大另类极品videosbest| 国产成人精品一区二区三区网站观看| 一区二区三区加勒比av| 2023国产精华国产精品| 91丨porny丨户外露出| 男人操女人的视频在线观看欧美| 中日韩免费视频中文字幕| 欧美无人高清视频在线观看| 老司机精品视频在线| 国产精品久久久久7777按摩| 欧美日韩国产色站一区二区三区| 国产在线视视频有精品| 亚洲一区二区在线免费看| 国产亚洲一二三区| 欧美老肥妇做.爰bbww| 99这里都是精品| 久久 天天综合| 日韩影院精彩在线| 国产一区二区三区免费看| 伊人开心综合网| 国产日韩欧美制服另类| 国产成人鲁色资源国产91色综| 亚洲韩国一区二区三区| 国产精品麻豆久久久| 日韩三级伦理片妻子的秘密按摩| 91丨九色丨尤物| 福利一区二区在线观看| 日本一区二区综合亚洲| 亚洲啪啪综合av一区二区三区| 亚洲色图欧洲色图婷婷| 亚洲综合色噜噜狠狠| 偷拍自拍另类欧美| 精品一区二区在线视频| 成人听书哪个软件好| 色婷婷精品大视频在线蜜桃视频| 欧美无乱码久久久免费午夜一区| 欧美日韩高清不卡| 日韩精品中文字幕在线一区| 精品99999| 国产精品视频第一区| 亚洲啪啪综合av一区二区三区| 亚洲午夜av在线| 久久超碰97人人做人人爱| 成人精品一区二区三区四区| 日本韩国视频一区二区| 欧美一区二区免费观在线| 久久久蜜桃精品| 一区二区三区.www| 精品亚洲免费视频| 99精品视频中文字幕| 欧美高清一级片在线| 久久久天堂av| 亚洲免费观看高清在线观看| 日本午夜一本久久久综合| 丁香桃色午夜亚洲一区二区三区| 色噜噜狠狠一区二区三区果冻| 欧美精品1区2区3区| 国产精品美日韩| 日韩中文字幕区一区有砖一区| 国产成人综合自拍| 7777精品伊人久久久大香线蕉经典版下载| 日韩精品一区二区三区视频在线观看| 中文字幕一区在线观看| 美腿丝袜在线亚洲一区| 91亚洲精华国产精华精华液| 精品日韩在线观看| 丝袜亚洲另类欧美| 99国产麻豆精品| 久久综合九色综合欧美就去吻| 中文字幕一区二区三区不卡在线| 久热成人在线视频| 欧美日韩中文字幕一区二区| 欧美国产欧美综合| 美女一区二区久久| 91久久精品午夜一区二区| 久久久久久久电影| 麻豆视频观看网址久久| 欧美日免费三级在线| 中文字幕一区二区三区不卡| 国产在线视视频有精品| 欧美一区二区三区免费观看视频| 亚洲免费伊人电影| 成人教育av在线| 久久久不卡网国产精品二区| 欧美aaa在线| 欧美精品高清视频| 亚洲成人你懂的| 欧美性大战久久久久久久蜜臀| 成人免费一区二区三区视频| 国产精品资源站在线| 精品国产伦一区二区三区免费| 亚洲成a人片在线观看中文| 色8久久精品久久久久久蜜| 国产精品人妖ts系列视频| 国产精品综合二区| 久久久一区二区| 国产精品亚洲一区二区三区在线| 日韩一级精品视频在线观看| 视频在线在亚洲| 欧美一区二区三区免费观看视频| 亚洲高清久久久| 欧美亚洲丝袜传媒另类| 亚洲一区在线观看免费| 色香蕉成人二区免费| 亚洲女爱视频在线| 在线亚洲人成电影网站色www| 亚洲婷婷综合久久一本伊一区 | 麻豆精品视频在线观看视频| 欧美一区日本一区韩国一区| 日韩电影在线一区二区三区| 欧美日本一区二区在线观看| 午夜久久久影院| 91麻豆精品国产91久久久久| 日韩主播视频在线| 日韩精品一区二区三区视频在线观看 | www国产成人| 国产91清纯白嫩初高中在线观看| 欧美激情一区在线| 91麻豆免费在线观看| 亚洲制服丝袜一区| 4438x亚洲最大成人网| 免费观看在线综合色| 欧美r级电影在线观看| 国产传媒久久文化传媒| 日韩一区中文字幕| 欧美日韩亚洲另类| 麻豆91免费观看| 欧美国产视频在线| 欧美午夜片在线观看| 蜜桃久久av一区| 中文字幕第一区二区| 色系网站成人免费| 日本午夜一本久久久综合| 26uuu国产日韩综合| 成人性视频网站| 亚洲大片在线观看| 欧美mv日韩mv国产网站| aaa欧美日韩| 日一区二区三区| 亚洲精品一区在线观看| 成人av在线播放网站| 天天亚洲美女在线视频| 久久影院视频免费| 一本大道久久a久久精二百| 蜜桃视频在线观看一区二区| 中文幕一区二区三区久久蜜桃| 欧洲国内综合视频| 韩国三级在线一区| 亚洲黄网站在线观看| 日韩你懂的在线播放| av成人动漫在线观看| 日韩电影免费一区| 国产精品丝袜黑色高跟| 欧美精品视频www在线观看| 国产精品 欧美精品| 亚洲大型综合色站| 欧美国产精品一区二区三区| 欧美亚洲精品一区| 国产a区久久久| 偷拍自拍另类欧美| 亚洲三级小视频| 精品免费国产一区二区三区四区| 一本色道久久综合亚洲aⅴ蜜桃| 精品一区二区三区在线视频| 亚洲欧美日韩国产综合| 久久伊99综合婷婷久久伊| 欧洲生活片亚洲生活在线观看| 国产激情视频一区二区三区欧美 | 性欧美大战久久久久久久久| 国产人伦精品一区二区| 欧美精品一级二级三级| 99久久综合国产精品| 韩国av一区二区三区四区| 视频一区二区不卡| 亚洲一区自拍偷拍|