How can I get the numbers from a vector?

1 次查看(过去 30 天)
X= rand(50,1)*(100-1)+1 I produced 50 random numbers between 1-100 with this code in a vector. I want to write the numbers between 45-50 to another vector.

采纳的回答

Matt J
Matt J 2014-12-21
anothervector=X(X>=45 & X<=50);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by