|
| 1 | +%========================================================================== |
| 2 | +% |
1 | 3 | % c2d_euler Transforms a continuous transfer function to a discrete |
2 | 4 | % transfer function using the forward and backward Euler methods. |
3 | 5 | % |
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') |
13 | 8 | % |
14 | 9 | % See also c2d |
15 | 10 | % |
16 | 11 | % MATLAB Central File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/90267-euler-c2d-transformation-c2d_euler |
17 | 12 | % GitHub: https://github.com/tamaskis/c2d_euler-MATLAB |
18 | 13 | % |
19 | 14 | % 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 |
21 | 16 | % included with the download. |
22 | 17 | % |
23 | 18 | % 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 | +%========================================================================== |
34 | 32 | function Hz = c2d_euler(Hs,T,type) |
35 | 33 |
|
36 | 34 | % symbolic variable for z; |
|
0 commit comments