English 中文(简体)
将信息总库分为高值和低值,低于Scalar价值
原标题:Divide Matrix into Higher and Lower Value than Scalar Value Input

I have some problem in matlab since I was new in this programming language. Okay here it is :

页: 1

1
1
1
3
4
4
4
5
6
6
7
7
9
9
9
9
9

It s only 1 column matrix. I want to divide the matrix into two groups with some scalar value. Is I choose 5 as the scalar so my matrix will be divide into two groups higher than 5 and lower than 5 :

预期结果:

下矩阵:

1
1
1
3
4
4
4
5

高级矩阵:

6
6
7
7
9
9
9
9
9

我已尝试使用<代码>max和min的指挥系统,但该指挥系统保持基体大小,将所有低于Scalar (5)的号码改为5。 这个问题自下个步骤以来,我想总结一下每个下层和更高的矩阵。

Could you suggest me some trick? Many thanks

最佳回答

你们可以采取合乎逻辑的做法来做到这一点:

LowValuesMatrix = Matrix(Matrix <= 5);
HighValuesMatrix = Matrix(Matrix > 5);

LowValuesMatrix =
 1
 1
 1
 3
 4
 4
 4
 5

HighValuesMatrix =
 6
 6
 7
 7
 9
 9
 9
 9
 9
问题回答

暂无回答




相关问题
How do I sort enum members alphabetically in Java?

I have an enum class like the following: public enum Letter { OMEGA_LETTER("Omega"), GAMMA_LETTER("Gamma"), BETA_LETTER("Beta"), ALPHA_LETTER("Alpha"), private final String ...

Grokking Timsort

There s a (relatively) new sort on the block called Timsort. It s been used as Python s list.sort, and is now going to be the new Array.sort in Java 7. There s some documentation and a tiny Wikipedia ...

Sorting twodimensional Array in AS3

So, i have a two-dimensional Array of ID s and vote count - voteArray[i][0] = ID, voteArray[i][1] = vote count I want the top 3 voted items to be displayed in different colors, so i have a 2nd Array -...

Linq operations against a List of Hashtables?

I m working with a set of legacy DAO code that returns an IList, where each Hashtable represents the row of a dynamically executed SQL query. For example, the List might contain the following records/...

C++ Array Sort Me

Stuck on an array sorter. Have to sort numbers from largest to smallest. I m trying two loops (one nested in the other). Here s the code: int counter=0; // inner counter int counter2=0; // outer ...

Can I Nest OrderBy in .NET?

This doesn t seem to work as I intend. VB.NET: Dim x = Model.Discussions.OrderByDescending(Function(d) d.Messages.OrderByDescending(Function(m) m.Sent).First.Sent) For Each d As Discussion In x ....

sorting elements javascript

I m looking for a way to sort my elements, but it isn t as easy as it sounds. Please let me explain My elements are grouped per 6 elements (thumbnails), each x represents a thumbnail However all ...

热门标签