vzoh_icon.m
来自「一个matlab的将军模型」· M 代码 · 共 35 行
M
35 行
function data = vzoh_icon(coord)
% Generate point for drawing symbol for VZOH.
%
% Syntax:
% "data = vzoh_icon(coord)"
%
% Description:
% If "coord = 1", "poly_icon(coord)" returns a row vector containing
% the sin of five points equally distributed between 0 and 2*pi. Otherwise,
% "poly_icon(coord)" returns the cos.
%
% Note:
% "poly_icon()" is used in generating the mask icon for the CheckMate
% variable zero-order hold blocks (VZOHs) in Simulink.
N = 100;
theta = [0:N]*2*pi/N;
b = sqrt(2)/2;
switch coord
case 1
data = [sin(theta)];
case 2
data = [cos(theta)];
case 3
data = [-b b 0 -b b -b];
case 4
data = [-b -b 0 b b -b];
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?