Clear Filters
Clear Filters

Error using InputOutputModel/subsref (line 43) Subscript no. 2 is out of range.

10 views (last 30 days)
Im trying to use the tf(),
I created the code weeks ago and no error appeared, when i open the document now its keeps showing
Subscript no. 2 is out of range.
beside each tf().
I am unsure why.
%(d)
R=230
L=47e-6
C=10e-9
LC=L*C
CR=C*R
G=tf(1,[LC,CR,1]);

Answers (1)

Vatsal
Vatsal on 14 May 2024
Hi,
after examining the provided code , it appears to be functioning correctly. The error message “Subscript no. 2 is out of range” typically signifies an attempt to access an element of an array or matrix beyond its bounds. In the context of the provided MATLAB code, this issue seems to be associated with the "tf()" function. A potential cause for this error might be a naming conflict with a variable called "tf" in your workspace, which MATLAB could be mistaking for the "tf()" function. To verify if this is the case, you can use the "whos" command in MATLAB to list all variables currently in your workspace. If you find a variable named "tf", consider removing it by executing the command "clear tf".
I hope this helps!

Community Treasure Hunt

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

Start Hunting!