Simulink/Matlab diference

조회 수: 2 (최근 30일)
Cosmin Darab
Cosmin Darab 2011년 10월 6일
Hy Is there a way that I can use roots in simulink and get the same result as in matlab? Does simulink use a different compiler than matlab?(I use roots in a matlab embaded function in simulink and get different results than in matlab). Thank you.
  댓글 수: 2
Titus Edelhofer
Titus Edelhofer 2011년 10월 6일
Hi Cosmin,
are the differences large (i.e., not "just" roundoff?). What results do you get?
Titus
Cosmin Darab
Cosmin Darab 2011년 10월 7일
Hi,
The results are almous the same but the last zecimals don't assembly(eg.0.001235876 and 0.001235012) but I use this numbers in an logarithm and the resuls are way different.
Thank You

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

채택된 답변

Walter Roberson
Walter Roberson 2011년 10월 6일
Simulink uses a different algorithm, and is documented as possibly returning the roots in a different order. So sort() the complex numbers and you should be fine to within roundoff limits (unless the polynomial was badly scaled.)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by