How to extract data to a certain number?

Say for example I have an array, x=(1:0.25:10) and I want only the data points up to a certain number. How would I do this?
Lest say I wanted all values up until I get the number 2.
(1,1.25,1.5, 1.75, 2) How could I extract just these numbers?

More Answers (0)

Community Treasure Hunt

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

Start Hunting!