bode function plot Help

I am trying to use the bode function on Matlab. The function i am trying to type in Matlab is H(s) = 10s/ (s+2).
This is my code
close all
clear all
s = tf('s')
H= 10*(s) /(s+2) ;
bode(H)
grid
x=1
The bottom is the error I keep getting.
Undefined function 'tf' for input arguments of type 'char'.
Error in Untitled (line 4)
s = tf('s')
How would i fix this?

2 件のコメント

Ameer Hamza
Ameer Hamza 2020 年 3 月 19 日
The line
s = tf('s')
is correct in MATLAB's syntax. Which version of MATLAB are you using?
Jackson
Jackson 2020 年 3 月 19 日
I am using MATLAB2019b

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2020 年 3 月 19 日
編集済み: Fangjun Jiang 2020 年 3 月 19 日

1 投票

You may not have the Control System Toolbox, which is required for having tf().
Run "ver control" to find out
>> H=tf([10,0],[1,2])
H =
10 s
-----
s + 2
Continuous-time transfer function.

4 件のコメント

Jackson
Jackson 2020 年 3 月 19 日
This is what happened when I ran ver control.
MATLAB Version: 9.7.0.1296695 (R2019b) Update 4
Operating System: Microsoft Windows 10 Home Version 10.0 (Build 17763)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Warning: No properly formatted Contents.m file was found for 'control'.
Ameer Hamza
Ameer Hamza 2020 年 3 月 19 日
Jack, this shows that you don't have Control System Toolbox installed. You need that to use tf().
Jackson
Jackson 2020 年 3 月 19 日
How do I install the Control System Toolboxs to MAtlab?
Fangjun Jiang
Fangjun Jiang 2020 年 3 月 19 日
Well, you need purchase, download and then install from the Mathworks website.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGet Started with Control System Toolbox についてさらに検索

タグ

質問済み:

2020 年 3 月 19 日

コメント済み:

2020 年 3 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by