在MATLAB中从矩阵中删除极值 [英] Removing extreme values from a Matrix in MATLAB

查看:416
本文介绍了在MATLAB中从矩阵中删除极值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个x-y个数据点的矩阵:

I have a matrix with x-y data points:

A= [x1 , y1; x2 , y2; x3 , y3]

A= [x1 , y1; x2 , y2; x3 , y3]

并且我想删除其y值高于平均值的选定点(行).

and i want to remove selected points (rows) that their y value is above some deviation from the average.

我该怎么做?

谢谢你, 罗恩

推荐答案

这似乎是您需要的:

A(abs(A(:,2)-mean(A(:,2)))>treshold,:) = []

如果您愿意,可以让阈值类似

If you want you can let the treshold be something like

1.234*std(A(:,2))

这篇关于在MATLAB中从矩阵中删除极值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆