'lqr' requires Control System Toolbox.

12 visualizzazioni (ultimi 30 giorni)
Anil Mohan
Anil Mohan il 12 Nov 2020
Commentato: Ameer Hamza il 12 Nov 2020
I've tried every possible option to check the error in this simple code. But Matlab throws me this error:
'lqr' requires Control System Toolbox.
Error in LST_lqrhw (line 19)
[K, S, e] = lqr(A, B, Q, R);
Can anyone help me with this or suggest an alternate method?
clear
clc
close all
A = [0 1;
1 1];
B = [1;
0];
Q = [1 0;
0 1];
R = [1;
0];
[K, S, e] = lqr(A, B, Q, R);

Risposta accettata

Ameer Hamza
Ameer Hamza il 12 Nov 2020
Modificato: Ameer Hamza il 12 Nov 2020
This means that you need to install the Control system toolbox: https://www.mathworks.com/help/control/. MATLAB has several toolboxes, and you need a license for a toolbox you use it in MATLAB.
You can run the following line
ver control
and if it throws a warning, then it means that you don't have the toolbox installed.
  2 Commenti
Anil Mohan
Anil Mohan il 12 Nov 2020
Thank you so much! That just worked perfectlyk fine.
Ameer Hamza
Ameer Hamza il 12 Nov 2020
I am glad to be of help!

Accedi per commentare.

Più risposte (0)

Tag

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by