Data interpolation problem for excel file

1 回表示 (過去 30 日間)
MUKESH KUMAR
MUKESH KUMAR 2018 年 6 月 28 日
編集済み: MUKESH KUMAR 2018 年 6 月 28 日
I had a excel file having 500 rows and 3 columns. In first column the data should be within the range of 200-250 but there are some data which are not in this range.So replace those data by using previous data history with in the specific range. Similarly for second column the data range should be 100-150 and replace the unwanted data and also do the same for column third. Thanks in advance

回答 (1 件)

Sammit Jain
Sammit Jain 2018 年 6 月 28 日
編集済み: Sammit Jain 2018 年 6 月 28 日
Hi Mukesh,
I'm assuming that 'previous data history' means 'previous value in that column which was within this range'. This seems like a good application of the fillmissing function in MATLAB
First find the values which are not in your desired range using simple comparison. Set these values to any form of missing value in MATLAB (NaN, [], etc). Once this is done, just use fillmissing with the kind of technique you require for the filling.
Here's a small example:
A = [10 15 17 18 45 11 14 87 43]';
A(A>20) = NaN;
fillmissing(A,'previous');
The original column A is:
A =
10
15
17
18
45
11
14
87
43
After you run the code, it becomes:
10
15
17
18
18
11
14
14
14
Hope this helps.
  1 件のコメント
MUKESH KUMAR
MUKESH KUMAR 2018 年 6 月 28 日
編集済み: MUKESH KUMAR 2018 年 6 月 28 日
For replacing a data, use previous 4-5 data sets and based on that find/predict the new data within that specific range. Use loop for all 3 column. Thanks

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

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by