フィルターのクリア

Comparing rows of a table

15 ビュー (過去 30 日間)
BN
BN 2020 年 4 月 10 日
コメント済み: Tommy 2020 年 4 月 11 日
Hey all,
I have a table, this table represents the value of creation coefficient (CC) and RMSE for 3 of my models. Now in each row, I want to compare CC and RMSE rows by rows. I would like to print the name of each model that has the nearest value to one (in comparison with each model) for CC after existing rows, and similarly, type then name of that model which has a lower value of RMSE.
So the output is a table just like that I attached but with 2 extra columns after existing columns now, one for CC and one for RMSE.
Here is a simple example:
Before:
After:
Please tell me how I can do this,
Thank you so much

採用された回答

Tommy
Tommy 2020 年 4 月 10 日
Let me know if this works:
[~,i] = min(1-[TEST.model1_CC, TEST.model2_CC, TEST.model3_CC],[],2);
[~,i2] = min([TEST.model1_RMSE, TEST.model2_RMSE, TEST.model3_RMSE],[],2);
names = TEST{1,{'model1','model2','model3'}}';
TEST.CC_CHECK = names(i);
TEST.RMSE_CHECK = names(i2);
  3 件のコメント
BN
BN 2020 年 4 月 11 日
編集済み: BN 2020 年 4 月 11 日
An Error Occurred when I clicked on Accept answer, I saw this problem earlier a few times, It will be fixed in a few hours, automatically. I click on accept answer a few hours later again.
Tommy
Tommy 2020 年 4 月 11 日
Happy to help! No worries

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series Objects についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by