Trying to figure out a algorithm to filter out some data, since I dont have any additional toolbox.
35 ビュー (過去 30 日間)
古いコメントを表示
Govind Sankar Madhavan Pillai Ramachandran Nair
2025 年 10 月 9 日 12:12
コメント済み: Star Strider
約8時間 前
Hi,
I have uploaded a mat file which contains two vectors e and v. e is for energy and v is for voltage, but thats not important. And I plot them like this.
plot(v,e);
grid on;
grid minor;
xlim([3.485,3.6]);
set(gca, 'XDir','reverse');

and when you plot the values, you get this plot with those spikes. I am trying to figure out how to remove those spikes, but i cant see any patterns. I dont have any toolbox, so i have to use matlab and my brain to figure this out. But i am currently struggling to come up with an idea. If anyone can help me, kindly please help me. Thank you.
0 件のコメント
採用された回答
Star Strider
2025 年 10 月 9 日 13:19
Using it on your data --
LD = load('eeandv.mat');
e = LD.e;
v = LD.v;
figure
plot(v,e);
grid on;
grid minor;
xlim([3.485,3.6]);
set(gca, 'XDir','reverse');
xlabel('v')
ylabel('e')
title('Original')
e = filloutliers(e, 'linear','movmedian',10);
figure
plot(v,e);
grid on;
grid minor;
xlim([3.485,3.6]);
set(gca, 'XDir','reverse');
xlabel('v')
ylabel('e')
title('Using ''filloutliers''')
.
2 件のコメント
その他の回答 (2 件)
Alan Stevens
2025 年 10 月 9 日 13:06
編集済み: Alan Stevens
2025 年 10 月 9 日 13:11
Here's one possibility, though it isn't a general solution, it just works for this data set
load('eeandv.mat')
xlo =3.485; xhi = 3.6;
ixlo = find(v==xlo); ixhi= find(v==xhi);
ylo = e(ixlo); yhi = e(ixhi);
x = [xlo, xhi];
y = @(x) ylo + (x-xlo)*(yhi-ylo)/(xhi-xlo);
e(e<y(v)) = NaN;
plot(v,e,'.');
grid on;
grid minor;
xlim([3.485,3.6]);
set(gca, 'XDir','reverse');
参考
カテゴリ
Help Center および File Exchange で Blue についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!