Skip to content

Commit

Permalink
New header format + example as live script.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskis committed Jun 1, 2021
1 parent 6ffd45d commit 3a42aed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 47 deletions.
27 changes: 0 additions & 27 deletions EXAMPLES.m

This file was deleted.

Binary file added EXAMPLES.mlx
Binary file not shown.
38 changes: 18 additions & 20 deletions c2d_euler.m
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
%==========================================================================
%
% c2d_euler Transforms a continuous transfer function to a discrete
% transfer function using the forward and backward Euler methods.
%
% Hz = c2d_euler(Hs,T,'forward') returns the discrete transfer function
% "Hz" obtained by applying the forward Euler (i.e. forward difference)
% transformation to a continuous transfer function "Hs", where "T" is the
% sampling period.
%
% Hz = c2d_euler(Hs,T,'backward') returns the discrete transfer function
% "Hz" obtained by applying the backward Euler (i.e. backward difference)
% transformation to a continuous transfer function "Hs", where "T" is the
% sampling period.
% Hz = c2d_euler(Hs,T,'forward')
% Hz = c2d_euler(Hs,T,'backward')
%
% See also c2d
%
% MATLAB Central File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/90267-euler-c2d-transformation-c2d_euler
% GitHub: https://github.com/tamaskis/c2d_euler-MATLAB
%
% See "DOCUMENTATION.pdf" for additional documentation and examples.
% Examples can also be found in EXAMPLES.m. Both of these files are
% Examples can also be found in EXAMPLES.mlx. Both of these files are
% included with the download.
%
% Copyright (c) 2021 Tamas Kis
% Last Update: 2021-04-10



%% FUNCTION

% INPUT: Hs - continuous transfer function
% T - sampling period
% type - 'forward' or 'backward'
% OUTPUT: Hz - discrete transfer function
% Last Update: 2021-05-31
%
%--------------------------------------------------------------------------
%
% INPUTS:
% Hs continous transfer function
% T (1x1) sampling period
% type 'forward' or 'backward'
%
% OUTPUTS:
% Hz discrete transfer function
%
%==========================================================================
function Hz = c2d_euler(Hs,T,type)

% symbolic variable for z;
Expand Down

0 comments on commit 3a42aed

Please sign in to comment.