Why do I get error when solve the bode plot

clear all
clc
R1=3143;
R2=5000;
R3=1000;
Rf=1000;
L=10000;
C1=2.53*(10^-5);
C2=3.1831*(10^-5);
num=[(R1*R2*C1*C2*L*(R3+Rf)^2) 0 0 0]; den=[(C1*C2*R1*R2*R3*L) (C1*R1*R3*L)+(C2*R2*R3*L) (R3*L)+(C2*R1*R2*R3) (R1*R3)];
sys=tf(num,den);
figure
bode(sys)

Respuestas (1)

Star Strider
Star Strider el 18 de Dic. de 2020

0 votos

Your code runs without error in R2020b.
What MATLAB version are you using?
What is the error?

4 comentarios

Kamar Ledgister
Kamar Ledgister el 18 de Dic. de 2020
2020b
These are errors
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
Error in bode_C1 (line 11)
den=[(C1*C2*R1*R2*R3*L) (C1*R1*R3*L)+(C2*R2*R3*L) (R3*L)+(C2*R1*R2*R3)
I get (1x4) double vectors for both ‘num’ and ‘den’ using the code you posted (no modifications), and get no errors. I also do not see that your code vertically concatenates anything. I also do not see any bode functions other than those in the Conmtrol System and System Identification Tookboxes in the online documentation.
The only other thing I can think of is that you have somehow created your own ‘bode’ function that is overshadowing the built-in bode functions.
Run this line from a script or your Command Window:
which bode -all
You should only get:
C:\Program Files\MATLAB\R2020b\toolbox\control\ctrlobsolete\bode.m
C:\Program Files\MATLAB\R2020b\toolbox\shared\controllib\engine\@DynamicSystem\bode.m % Shadowed DynamicSystem method
If anything else appears, that is the problem. The solution is to re-name the function you created to something else that makes sense in context and does not overshadow any MATLAB function.
Kamar Ledgister
Kamar Ledgister el 18 de Dic. de 2020
Thank you
Star Strider
Star Strider el 18 de Dic. de 2020
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 18 de Dic. de 2020

Comentada:

el 18 de Dic. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by