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)

Respuestas (1)

Roger Stafford
Roger Stafford el 6 de Feb. de 2015
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.

La pregunta está cerrada.

Etiquetas

Preguntada:

el 6 de Feb. de 2015

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by