image thumbnail

A Fully Automated Flowgraph Analysis Tool for MATLAB

by

 

22 Mar 2005 (Updated )

A handy signal flow graph analysis tool for exploring transfer function(s) of a given system.

flowdemo.m
clc
fprintf('An example of a two-input, one-output system\n')
fprintf('Two symbolic transfer functions are H.sym{1} H.sym{2}.\n\n>> H=flow_tf(''CRFBSYM.flw'')\n')

H=flow_tf('CRFBSYM.flw');

fprintf('\n\nanalysis completed, press space to continue')
pause,clc
fprintf('\nthese are results: \n\nsymbolic transfer function from input #1 to output H.sym{1}:')
pretty(H.sym{1})
fprintf('\nsymbolic transfer function from input #2 to output H.sym{2}:')
pretty(H.sym{2})
fprintf('\nPress space to continue')
pause,clc
fprintf('\nNow, lets define some suitable numerical transfer functions \nfrom inputs 1 and 2')
fprintf(' to output. They are called NTF and STF:\n')
Z =[1  0.98845633533019-0.15150601686275*i  0.98845633533019+0.15150601686275*i];
P =[0.66565129102841     0.76176005475970-0.28226068883151*i 0.76176005475970+0.28226068883151*i];
K =1;
fprintf('\nnumerical transfer function from input #1 to output:\nNTF =\n\n')
NTF=zpk(Z,P,K,1)
fprintf('\nnumerical transfer function from input #2 to output:')
STF=1
fprintf('\nPress space to continue')
pause,clc
fprintf('\nNow, we will find numerical values to the coefficients in H')
fprintf('\nby comparing numerical and symbolic transfer functions\n\n>> out=find_params([NTF STF],[H.sym{2} H.sym{1}])')

out=find_params([NTF STF],[H.sym{2} H.sym{1}])

Contact us