超过1个标准差MATLAB排除数据 [英] MATLAB excluding data outside 1 standard deviation

查看:270
本文介绍了超过1个标准差MATLAB排除数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有经验与MATLAB,所以遗憾的新手问题:

I'm inexperienced with MATLAB, so sorry for the newbie question:

我有一个大的载体(905350元),其存储一大堆在它的数据。
我有标准偏差和平均的,现在我要切出是高于/低于平均值的一个标准偏差的所有数据点。
我只是不知道如何。从我收集我必须作出某种形式的双回路?

I've got a large vector (905350 elements) storing a whole bunch of data in it. I have the standard deviation and mean, and now I want to cut out all the data points that are above/below one standard deviation from the mean. I just have no clue how. From what I gather I have to make a double loop of some sort?

这就像:平均-STD<数据我想<意味着+ STD。

It's like: mean-std < data i want < mean + std

推荐答案

如果数据在变量 A ,与存储在 meanA均值并保存在 STDA 标准偏差,那么下面将提取您想同时保持数据值的原始顺序的数据:

If the data is in variable A, with the mean stored in meanA and the standard deviation stored in stdA, then the following will extract the data you want while maintaining the original order of the data values:

B = A((A > meanA-stdA) & (A < meanA+stdA));

下面是对上面使用的概念触及一些有用的文档链接:<一个href=\"http://www.mathworks.com/access/helpdesk/help/techdoc/ref/logicaloperatorselementwise.html\">logical运营商,矩阵索引

Here are some helpful documentation links that touch on the concepts used above: logical operators, matrix indexing.

这篇关于超过1个标准差MATLAB排除数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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