test_halfwave.m

来自「电力系统书本的范例 想学好电力系统很有帮助 欢迎大家来下载」· M 代码 · 共 17 行

M
17 行
字号
% M-file: test_halfwave.m
% M-file to calculate the ripple on the output of a half-wave
% rectifier.

% First, generate the output of a half-wave rectifier
waveform = zeros(1,128);
for ii = 1:128
   waveform(ii) = halfwave(ii*pi/64);
end

% Now calculate the ripple factor
r = ripple(waveform);

% Print out the result
string = ['The ripple is ' num2str(r) '%.'];
disp(string);

⌨️ 快捷键说明

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