What is wrong with this code?

What is wrong with this code?
clc;
clear all;
close all;
n1=1;n2=25; den = [1 6 25];
step =[n1,den];
title('Transfer function when numerator = 1')
figure, step=[n2,den];
title('Standard transfer function')

1 commentaire

Original question:
What is wrong with this code?
clc;
clear all;
close all;
n1=1;n2=25; den = [1 6 25];
step =[n1,den];
title('Transfer function when numerator = 1')
figure, step=[n2,den];
title('Standard transfer function')

Connectez-vous pour commenter.

Réponses (1)

madhan ravi
madhan ravi le 9 Juil 2020

0 votes

clear all % never name a variable step
n1=1;
n2=25;
den = [1 6 25];
Tf =tf(n1,den);
figure(1)
step(Tf)
title('Transfer function when numerator = 1')
figure(2), Tf1=tf(n2,den);
step(Tf1)
title('Standard transfer function')

4 commentaires

jake carl
jake carl le 10 Juil 2020
There is an error in the fifth line, I tried more than once to modify it, and I did not understand what was wrong
Image Analyst
Image Analyst le 10 Juil 2020
You forgot to give us the error -- ALL the red text. Jake, make it easy for people to help you, not hard.
jake carl
jake carl le 10 Juil 2020
Error in Untitled35 (line 5)
Tf =tf(n1,den);
it is like this
madhan ravi
madhan ravi le 10 Juil 2020
Modifié(e) : madhan ravi le 10 Juil 2020
Nope , that’s not the entire error message. Either you do don’t Control System Toolbox or a valid license for it or you created a file named tf.m if so remove it from the path or rename it.

Connectez-vous pour commenter.

Question posée :

le 9 Juil 2020

Modifié(e) :

le 10 Juil 2020

Community Treasure Hunt

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

Start Hunting!

Translated by