Error when using step-command
이전 댓글 표시
I want to plot the step response of a transfer function but when I use step() i get an error message. I have tried to paste example-code from the matlab help but I still get error.
This is the example code:
(https://se.mathworks.com/help/control/ref/lti.step.html#d122e120846)
sys = tf(4,[1 2 10]);
step(sys)
The message I get is:
"Unable to use a value of type tf as an index."
Anyone who knows what might be wrong?
댓글 수: 1
Jon
2020년 9월 25일
I can't reproduce the problem running R2020a Update 3. I get a nice step response plot with those same two commands.
I assume you have tried clearing the workspace first, or reopening MATLAB completely just to make sure that there isn't some other variable assignment confusing things, and then, just type those two lines of code
채택된 답변
추가 답변 (1개)
Fangjun Jiang
2020년 9월 25일
tf() is supposed to define a Transfer Function. You might have a variable called "tf" or other function called "tf". Do the following and see what are the returns
tf
which -all tf
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!