I can't detect error in formula
이전 댓글 표시
There's an error in this code which I failed to detect. Hopefully someone can help me. Thank you in advance.
T3(t,1)=(((q_inc*z_env*d_abs)*((1/zeta3)+((1-zeta4)*delta3/(zeta4*delta4)))+sigma*pi*delta3*(T4(t,1))^4)/(sigma*pi*delta3))^(1/4);
Also, I am also don't understand what does the picture means. Im still new with MATLAB.
답변 (2개)
Sulaymon Eshkabilov
2021년 6월 13일
Without the knowledge of your variables and their size, one point is clear that is an elementwise operation is needed for * and /. Thus, .* and ./ are to be introduced in the equation, see e.g.:
T3(t,1)=(((q_inc*z_env*d_abs).*((1./zeta3)+((1-zeta4).*delta3./(zeta4.*delta4)))+sigma.*pi*delta3.*(T4(t,1)).^4)./(sigma.*pi*delta3)).^(1/4);
Star Strider
2021년 6월 13일
The error indicates that the exponentiation needs to be element-wise, using .^ rather than ^ —
T3(t,1)=(((q_inc.*z_env.*d_abs).*((1./zeta3)+((1-zeta4).*delta3./(zeta4.*delta4)))+sigma.*pi.*delta3.*(T4(t,1)).^4)./(sigma.*pi.*delta3)).^(1/4);
(This makes all the operations element-wise.) However, unless all the vectors are column vectors, and ‘t’ is an integer greater than 0, the assignment is going to fail.
.
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!