Changing Default Function Matlab?

조회 수: 1 (최근 30일)
Tanmay
Tanmay 2014년 11월 25일
답변: Luuk van Oosten 2014년 11월 25일
I'm trying to run the following code:
clear tf; a = tf([5],[0.8 1])
which gives "Undefined function 'tf' for input arguments of type 'double'."
I checked for license and got the following reply
license('test', 'control_toolbox')
ans =
1
I tried which tf -all
which gave me the following response C:\Program Files\MATLAB\R2012b\toolbox\ident\ident\@idParametric\tf.m % idParametric method C:\Program Files\MATLAB\R2012b\toolbox\shared\controllib\engine\@StaticModel\tf.m % StaticModel method C:\Program Files\MATLAB\R2012b\toolbox\signal\signal\@dfilt\tf.m % dfilt method
so is the error due to the fact that the default tf function is not the desired one. and if so then how to solve the problem???

답변 (1개)

Luuk van Oosten
Luuk van Oosten 2014년 11월 25일
Dear Tanmay,
Looks like your input arguments for the function 'tf' must be of the type 'single'.
Example: if 'B' is of the type double, you can make it a single by:
A = single(B)

Community Treasure Hunt

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

Start Hunting!

Translated by