Please please help fix my error!

RH2 = 5980;
theta1H2 = 8.314/(2*1.0079)*1000;
T = 0.1:1:6000;
cvH2 = (3+2)*.5*RH2 + ((theta1H2./(2*T)).^2)/(((sinh(theta1H2./2*T))).^2)*RH2;
I receive the warning message:
'Warning: Rank deficient, rank = 0, tol = NaN.'
This shows up almost 100 times during my code (same formula)

답변 (1개)

Roger Stafford
Roger Stafford 2015년 2월 6일

0 개 추천

In the equation for 'cvH2' you are doing a matrix right divide when you use "/" without the dot. You are doing a matrix division of one long row vector by another row vector of the same length. This is the source of your trouble. The quantity to the right of the division sign becomes infinite over the range of T because of the nature of the 'sinh' function, since its argument, "theta1H2./2*T", becomes so large. Read the documentation for 'mrdivide' at
http://www.mathworks.com/help/matlab/ref/mrdivide.html
which states, "MATLAB® displays a warning message if A is badly scaled or nearly singular, but performs the calculation regardless." In your case it is certainly badly scaled.

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

태그

질문:

2015년 2월 6일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by