What is the difference b/w these 2 c2d options?

Type this in matlab:
>> s=tf('s'); Hs=exp(-2*s)*(5*s+1)/(s*s+8*s+16)
What is the difference between:
>> Hd=c2d(Hs,0.1,'tustin')
and
>> Hd=c2d(Hs,0.1,'method','tustin')
?
It blows my mind, but the result is different! I didn't find any clarifing answer in the help.

Answers (1)

I found the behavior weird, but I could find the eplanation, It seems that the function c2d recognize what method to use by reading the first letter of the first string. You have five methods 'zoh', 'foh', 'impulse', 'tustin', or 'matched'
Hd1=c2d(Hs,0.1,'tutsin') % or
Hd1=c2d(Hs,0.1,'t') % or
Hd1=c2d(Hs,0.1,'tall')
The three previous lines of code are using the same method 'tutsin', because the first letter is t
The following code use 'matched' method, because the first letter in the string 'method' is m, the second string 'tutsin' is ignored
Hd1=c2d(Hs,0.1,'method','tutsin')

Products

Asked:

on 14 Aug 2016

Edited:

on 14 Aug 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!