使用选择操作 mathematica 中的列表 [英] manipulate list in mathematica with select

查看:36
本文介绍了使用选择操作 mathematica 中的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将一些数据导入 Mathematica.数据将类似于

I have imported some data into Mathematica. The data will look similar to

{{0,2},{2,3},{4,3},{5,4},{8,4}}

我想丢弃 x 值小于给定值的所有元素,或者创建一个包含 x 值大于此值的数据的新列表.我认为 Select 应该完成这项工作,但我不知道如何.

I want to throw out all elements for which the x-values are smaller than a given value or create a new list that contains the data for which the x-values are larger than this value. I assume that Select should do the job but I don't know how.

预先感谢您的帮助.

推荐答案

怎么样

 data = {{0,2},{2,3},{4,3},{5,4},{8,4}};
 filtered = Select[data, First[#]>3&];

在哪里用给定的值替换 3?

where you replace 3 with your given value?

这篇关于使用选择操作 mathematica 中的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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