⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arraymax.m

📁 数字通信第四版原书的例程
💻 M
字号:
function [sys, x0, str, ts] = arraymax(t,x,u,flag)
%ARRAYmax outputs the index of the maximum input.
%       This M-file is designed to be used in a SIMULINK S-function block.
%       This function will detecte the maximum number from the input and 
%       output the index number where the maximum number occured.

%       Wes Wang 4/13
%       Copyright (c) 1995-96 by The MathWorks, Inc.

if flag == 3
    sys = find(u==max(u));
    sys = sys(1) - 1;    
elseif flag == 0
    sys=zeros(7,1);
    %one sample rate
    sys(7) = 1;
    sys(4) = -1;
    sys(3) = 1;
    x0 = [];
    ts = [-1. 0];
else
    sys = [];
end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -