필터 지우기
필터 지우기

How the results are stored in a .xlsx file?

조회 수: 1 (최근 30일)
stelios loizidis
stelios loizidis 2020년 8월 21일
댓글: stelios loizidis 2020년 8월 24일
Hello,
I have the following problem: I want to calculate the RMSE. More specifically I run the algorithm five times and then add the resulting results and divide by five to calculate the average RMSE((RMSE1+RMSE2+RMSE3+RMSE4+RMSE5)/5). I use the command writecell but only the last value of the error is saved the rest is lost. How to save the error every time I run the algorithm ? Below I attach a part of the code.
Your help is important !!!
results = {DA,RMSE};
writecell(results,'results.xlsx')
  댓글 수: 1
Rik
Rik 2020년 8월 21일
If you call this code every iteration, writecell will overwrite the file every time, just like you tell it to.

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

채택된 답변

Utkarsh Belwal
Utkarsh Belwal 2020년 8월 24일
According to me during every iteration the writecell function is overwriting the previous results, that's why you are getting only last value saved. Use the function as shown below to append at the bottom for every iteration,
writecell(results , 'results.xlsx' , 'WriteMode' , 'append');
Look into the documentation for more information.
DISCLAIMER: These are my own views and in no way depict those of MathWorks.
  댓글 수: 1
stelios loizidis
stelios loizidis 2020년 8월 24일
You are absolutely right. I tried it and it works. Thank you very much!!!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by