Hi,im a beginner in matlab. I need to plot for a rmse matrix. i need to calculate the rmse and reshape it into a heatmap (a 8x5 matrix). How do I calculate the rmse of 40 models and one observation? i have listed out my models in the code, and am retrieving it from 'odat' for observation and 'gdat' for the 40 models. i've looked through all the rmse commands but i couldn't really understand, so need some help on it.

댓글 수: 4

Sam Chak
Sam Chak 2022년 9월 28일
Don't worry about the commands now.
Try describing the mathematical formula of your rmse matrix first.
We'll see which one suits your application.
i have the data of the annual cycle of sea surface temperature produced by 40 climate models and will need to compare it with the data of an observation. i've done calculating and plotting the same thing for correlation matrix using:
[R,p]=corrcoef(odat,gdat);
Rval(g,1) = R(1,2);
pval(g,1) = p(1,2);
and reshape it into:
Rval_matrix = reshape(Rval,8,5);
pval_matrix = reshape(pval,8,5);
however now i would need to calculate the rmse and not sure how to do it
Adam Danz
Adam Danz 2022년 9월 29일
Have you explored rmse, introduced in MATLAB R2022b?
yes. i've tried using the E = rmse(F,A), but it only gives one value of rmse. How do i make sure i get values for all the models?

댓글을 달려면 로그인하십시오.

 채택된 답변

KSSV
KSSV 2022년 10월 2일
편집: KSSV 2022년 10월 2일

0 개 추천

Let O be your observation data array of size mX1 and M be your model data array of size mx40.
O = rand(30,1) ;
M = rand(30,40) ;
RMSE = sqrt(mean((O - M).^2));
RMSE = reshape(RMSE,8,5) ;
pcolor(RMSE)
colorbar
You arrange all your models into an array and get them to the same dimensions of Observations.

댓글 수: 3

thank you, i managed to plot like so. but, would you care to explain how do i determine the dimension size (m), as what you did is 30?
Fariz Syafiq Mohamad Ali
Fariz Syafiq Mohamad Ali 2022년 10월 2일
편집: Fariz Syafiq Mohamad Ali 2022년 10월 2일
oh sorry, i realised that there's only a total of 28 boxes/models (7x4) when it should be 8x5. an example of what im expecting;
KSSV
KSSV 2022년 10월 2일
Just to show an example I have taken 30....it depends on your data. Hope you problem is solved?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2022년 9월 28일

댓글:

2022년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by