Hi,
I have a 41380 x 31 table
I am looking to see if the data is defined by temperature. The system has two temperature sensors 1 inside (1) and 1 outside (2). Every now and again one of the sensors (2) didnt work properly so I would like to remove any data when this occurred. When the inside temperature doesnt work properly it effects the processed results. I know that sensor 1 is the reliable sensor and sensor 2 is not. I would like to remove any data where sensor 2 was reading above 3 degrees than sensor 1. Can I use rmoutliers for this? If so how code it correctly to do so? Any other suggestions are welcome. I want to temporarily remove this data just to see if the results when processed correctly are temperature dependent.
this is what happens in my table now and again.

6 件のコメント

Jonas
Jonas 2021 年 5 月 15 日
編集済み: Jonas 2021 年 5 月 15 日
if sensor 1 is column 1 and sensor 2 is column 2 you can remove rows where column 2 is more than 3 degrees higher than column 1 by using
tbl(tbl(:,1)+3<=tbl(:,2),:)=[];
Aedin McAleer
Aedin McAleer 2021 年 5 月 15 日
Hey, I get the following error when I try this:
Operator '+' is not supported for operands of type 'table'.
Jonas
Jonas 2021 年 5 月 15 日
編集済み: Jonas 2021 年 5 月 15 日
oh sorry, it is a matlab table, i thought it is an array and you call it table
then use
tbl(tbl{:,1}+3<=tbl{:,2},:)=[];
Aedin McAleer
Aedin McAleer 2021 年 5 月 15 日
編集済み: Aedin McAleer 2021 年 5 月 15 日
I converted the table to an array and tried the original code you suggested and it worked, thanks for you help!
Image Analyst
Image Analyst 2021 年 5 月 15 日
@Jonas, can you transfer your "Comment" down to the official "Answer" section, where you can get credit (reputation points) for it?
Right now, your Answer is up here in the Comments section. The Comment section is used to ask posters to clarify their question, like to attach their variable(s) in a .mat file or something.
Jonas
Jonas 2021 年 5 月 15 日
of course!

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

 採用された回答

Jonas
Jonas 2021 年 5 月 15 日
編集済み: Jonas 2021 年 5 月 15 日

1 投票

for an array use
tbl(tbl(:,1)+3<=tbl(:,2),:)=[];
and for a matlab table use
tbl(tbl{:,1}+3<=tbl{:,2},:)=[];

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

質問済み:

2021 年 5 月 15 日

編集済み:

2021 年 5 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by