Skip to content

Commit 3a42aed

Browse files
committed
New header format + example as live script.
1 parent 6ffd45d commit 3a42aed

File tree

3 files changed

+18
-47
lines changed

3 files changed

+18
-47
lines changed

EXAMPLES.m

Lines changed: 0 additions & 27 deletions
This file was deleted.

EXAMPLES.mlx

5.18 KB
Binary file not shown.

c2d_euler.m

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
1+
%==========================================================================
2+
%
13
% c2d_euler Transforms a continuous transfer function to a discrete
24
% transfer function using the forward and backward Euler methods.
35
%
4-
% Hz = c2d_euler(Hs,T,'forward') returns the discrete transfer function
5-
% "Hz" obtained by applying the forward Euler (i.e. forward difference)
6-
% transformation to a continuous transfer function "Hs", where "T" is the
7-
% sampling period.
8-
%
9-
% Hz = c2d_euler(Hs,T,'backward') returns the discrete transfer function
10-
% "Hz" obtained by applying the backward Euler (i.e. backward difference)
11-
% transformation to a continuous transfer function "Hs", where "T" is the
12-
% sampling period.
6+
% Hz = c2d_euler(Hs,T,'forward')
7+
% Hz = c2d_euler(Hs,T,'backward')
138
%
149
% See also c2d
1510
%
1611
% MATLAB Central File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/90267-euler-c2d-transformation-c2d_euler
1712
% GitHub: https://github.com/tamaskis/c2d_euler-MATLAB
1813
%
1914
% See "DOCUMENTATION.pdf" for additional documentation and examples.
20-
% Examples can also be found in EXAMPLES.m. Both of these files are
15+
% Examples can also be found in EXAMPLES.mlx. Both of these files are
2116
% included with the download.
2217
%
2318
% Copyright (c) 2021 Tamas Kis
24-
% Last Update: 2021-04-10
25-
26-
27-
28-
%% FUNCTION
29-
30-
% INPUT: Hs - continuous transfer function
31-
% T - sampling period
32-
% type - 'forward' or 'backward'
33-
% OUTPUT: Hz - discrete transfer function
19+
% Last Update: 2021-05-31
20+
%
21+
%--------------------------------------------------------------------------
22+
%
23+
% INPUTS:
24+
% Hs continous transfer function
25+
% T (1x1) sampling period
26+
% type 'forward' or 'backward'
27+
%
28+
% OUTPUTS:
29+
% Hz discrete transfer function
30+
%
31+
%==========================================================================
3432
function Hz = c2d_euler(Hs,T,type)
3533

3634
% symbolic variable for z;

0 commit comments

Comments
 (0)