How to find roots of a polynomial equation in simulink using matlab function

조회 수: 1 (최근 30일)
Hi, I am trying to find the value of T in the equation:
log10(Psat) = (- 2.18) + (2.95(e-2)*T) - (9.18e(-5)*T^2) + (1.44e(-7)*T^3)
I am using matlab function to find the value of T using log10(Psat)+2.18 as the value of u,
In the matlab function , I am writing code as
function y = fcn(u)
y = roots([1.44*exp(-7),-9.18*exp(-5),2.95*exp(-2),-u]);
end
I am attaching the simulink block also. I am getting an error as " Data 'y' is inferred as a variable size matrix, while its properties in the Model Explorer specify its size as inherited or fixed. Please check the 'Variable Size' check box and specify the upper bounds in the size field."
Also, as it is a polynomial function of order 3, we will get three values of T (1 real and 2 complex), How to display the real value only and to use it further in the model.
Please help me with the same. Thanks in advance

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by