Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

"Array indices must be positive integers or logical values" on solving a cubic equation

1 visualizzazione (ultimi 30 giorni)
I am getting the error "Array indices must be positive integers or logical values" on solving a cubic equation.
c1 = 0.6;
c2 = 0.095;
c3 = 47500;
c4 = 0.0026;
wBar = [-c2*c4 -0.106*c2 -36.6*c2 c3*c1];
disp(roots(wBar));
Kindly help.

Risposte (1)

madhan ravi
madhan ravi il 9 Set 2019
Either you must have a variable named roots or disp , therefore clear it from workspace:
clear roots disp

Questa domanda è chiusa.

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by