필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
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.
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 9월 9일
Works for me. I suspect that earlier you accidentally defined a variable named roots and it is still in you workspace.
clear roots

답변 (1개)

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

이 질문은 마감되었습니다.

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by