why i get 'complex double' type?

조회 수: 71(최근 30일)
ali yaman
ali yaman 2021년 7월 21일
댓글: ali yaman 2021년 7월 22일
Hi, i have below code. When run it i get kro as complex double.
Do you have any idea about why it is complex number, and how i can fix it.
By the way krw is not complex, just kro is complex.
swi=0.328; sor=0.205;

채택된 답변

Walter Roberson
Walter Roberson 2021년 7월 21일
Although algebraically the maximum swd value should be 1 exactly, because of round-off error it turns out to be just slightly greater than 1. Then 1 minus that can be just slightly negative. Negative raised to a fraction is complex.
Take min(swd, 1)
  댓글 수: 3
ali yaman
ali yaman 2021년 7월 22일
i got it. Thank you very much

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

추가 답변(0개)




Community Treasure Hunt

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

Start Hunting!

Translated by