Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to do the matrix calculations

조회 수: 1 (최근 30일)
Mingda Wang
Mingda Wang 2014년 1월 12일
마감: MATLAB Answer Bot 2021년 8월 20일
Dear all, Here is the question. I have two matrices named Matrix A(temperature data) and Matrix B(salinity data). I wanna calculate Matrix C(density data), and we know C(density) is a function of A(temperature) and B(salinity). And I hope to plot the figure, for which, density variations with the time. Best regards, Mingda
  댓글 수: 3
Mingda Wang
Mingda Wang 2014년 1월 12일
편집: Matt J 2014년 1월 12일
Sorry, I did not make it clear, the formula is like this
rho_0 = 999.842594+6.793952e-2*T-9.095290e-3*T.^2+...
1.001685e-4*T.^3-1.120083e-6*T.^4+6.536335e-9*T.^5;
% --eqn (2):
A = 8.24493e-1-4.0899e-3*T+7.6438e-5*T.^2-8.2467e-7*T.^3+5.3875e-9*T.^4;
% --eqn (3):
B = -5.72466e-3+1.0227e-4*T-1.6546e-6*T.^2;
% --eqn (4):
C = 4.8314e-4;
% --eqn (5):
rho = rho_0+A.*S+B.*S.^(3/2)+C.*S;
source code (https://github.com/GLEON/Lake-Analyzer/blob/master/Source/waterDensity.m)
and I have already got A and B and the formula C=fx(A,B),wanna the C result
Amit
Amit 2014년 1월 12일
The equation you wrote are right and should give you the answer. Isn't rho the solution you want? Are you having trouble exporting the data as vector T for temperature and S for salinity?

답변 (2개)

Youssef  Khmou
Youssef Khmou 2014년 1월 12일
As you have the formula, you can get C given rho0 and rho are known :
C=(rho-rho0-A*S-B*S^(3/2))*inv(S);
  댓글 수: 3
Youssef  Khmou
Youssef Khmou 2014년 1월 13일
alright Mingda, so is the problem solved ?
Mingda Wang
Mingda Wang 2014년 1월 13일
:( not yet, the values in Matrix A,Matrix B and Matrix C are with correspondence, to be specific, C1=fx(A1,B1),C2=fx(A2,B2).I still could not get access to the calculation of Matrix C

Mingda Wang
Mingda Wang 2014년 1월 13일
problem solved by excel

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by