Attached you can find the data. Please rename .csv to .dat, and just use:
load cond2a.dat
Ax=cond2a(:,1);
Ay=cond2a(:,2);
Az=cond2a(:,3);
Znew=medfilt2(Az);
The file contains xyz with z values around 169. But using medfilt2 at the four corners the data is 0. How can I prevend this?
Thanks a lot,
Harry

 채택된 답변

Subhadeep Koley
Subhadeep Koley 2020년 2월 10일

1 개 추천

Your Az vector is mainly concentrated around 169, therefore normal median filtering destroys the sudden peaks. Using Padding option as 'symmetric' might help. Refer the code below.
load cond2a.dat
Ax = cond2a(:, 1);
Ay = cond2a(:, 2);
Az = cond2a(:, 3);
Znew = medfilt2(Az, 'symmetric');
figure; plot(Az);
hold on;
plot(Znew);
legend({'Original Data', 'Median filtered data'});
medfilteredData.png

댓글 수: 1

Harald von der Osten
Harald von der Osten 2020년 2월 10일
thanks a lot for your help, especially for pointing out the option 'symmetric'. Harry

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by