why the bode function doesn't work?

조회 수: 46 (최근 30일)
jia ming chen
jia ming chen 2015년 1월 19일
답변: Felix Götze 2016년 2월 9일
this is my problem...
>> s=tf('s')
s =
s
Continuous-time transfer function.
>> g=1/(1+s)
g =
1
-----
s + 1
Continuous-time transfer function.
>> bode(g) Error using DynamicSystem/bode (line 97) Index exceeds matrix dimensions.
can anyone solve it?

답변 (3개)

Felix Götze
Felix Götze 2016년 2월 9일
Hi,
I had the same Problem. In my case the error occured because I had a figure window open. If you have an open figure close it and try the command again it should work properly now.

Youssef  Khmou
Youssef Khmou 2015년 1월 19일
편집: Youssef Khmou 2015년 1월 19일
The description is correct and the code is working correctly,try clearing the existing variables
clear all;
s=tf('s'); g=1/(1+s); bode(g);
  댓글 수: 2
jia ming chen
jia ming chen 2015년 1월 19일
no, it still doesn't work. i think is a problem of che code or my matlab version... the system says that there is a problem in the line 97 of the code , but I've never touched the source of the code.
Youssef  Khmou
Youssef Khmou 2015년 1월 20일
편집: Youssef Khmou 2015년 1월 20일
Bode function contains the following code from line 92 through 100
92 case 3
93 % Transfer function form with time vector
94 if size(a,1)>1,
95 % SIMO syntax
96 a = num2cell(a,2);
97 den = b;
98 b = cell(size(a,1),1);
99 b(:) = {den};
100 end

댓글을 달려면 로그인하십시오.


Andreas Goser
Andreas Goser 2015년 1월 20일
Can you verify the output of
which bode -all
Youe should get something like this:
C:\Program Files\MATLAB\R2014b\toolbox\control\ctrlobsolete\bode.m
C:\Program Files\MATLAB\R2014b\toolbox\shared\controllib\engine\@DynamicSystem\bode.m % DynamicSystem method
Is not, there maybe another function or variable shadowing the bode function you want.
  댓글 수: 2
Lukas Kurmann
Lukas Kurmann 2015년 3월 18일
Hi all,
as stupid it may sound, I have the same problem - bode is not working (any more). Checked possible shadowing, but it seems not the case... Maybe my path is too long (C:\Projects\FHNW\Vorlesungen\HT FHNW\LF Medizinische Automatisierungssysteme\2015FS\03.Unterrichtsvorbereitung\20150316 WK12 - Block 9 - Diskrete Regler\MATLAB')?
Run currently the 8.3.0.532 (R2014a) version, but shall I update to the R2015a? Thx for an answer! BR Lukas
Andreas Goser
Andreas Goser 2015년 3월 19일
This user had a different error message. The solution was a compatibility with a 3rd part toolbox. Once this was removed from the path, BODE was working fine.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Control System Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by