give y region from x region of a data set

1 次查看(过去 30 天)
I have imported a .dat file into matlab, with data for a x axis and for the y axis. I want to specify a region on the x-axis (like a<x<b) and then I want the corresponding y values saved. I understand how to get the x values but not how to get the corresponding y values.

回答(1 个)

Walter Roberson
Walter Roberson 2016-10-31
mask = a <= x & x <= b;
selected_x = x(mask);
selected_y = y(mask);

标签

Community Treasure Hunt

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

Start Hunting!

Translated by