Unable to use a value of type tf as an index. How to fix?
62 次查看(过去 30 天)
显示 更早的评论
num=[(-number1),(number2)];
den=[(number3), (number4))];
sys1 = tf(num, den);
fb = bandwidth(sys1)
Having issues when running this saying that I am unavailable to use value of TF as an index. Any suggestions to fix this?
0 个评论
采纳的回答
Walter Roberson
2024-1-3
You will find that bandwidth is a variable but that you are trying to use it as a function call.
2 个评论
Steven Lord
2024-1-3
Rename the variable you've created that's named bandwidth to something else. While that variable exists in the workspace you will be unable to call the bandwidth function.
更多回答(1 个)
Ayush
2024-1-3
Hi @Rohan Gulur
The error message "Unable to use a value of type tf as an index" suggests that there is a syntax error in the code. It seems like there is an extra parenthesis in the den array definition which is causing the problem.
You can try this code:
number1 = ...; % Your value for number1
number2 = ...; % Your value for number2
number3 = ...; % Your value for number3
number4 = ...; % Your value for number4
num = [-number1, number2];
den = [number3, number4];
sys1 = tf(num, den);
fb = bandwidth(sys1);
Thanks,
Ayush
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Repeated Measures and MANOVA 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!