Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个包含 2 列 (x,y) 的数据集绘图向量但是,我不想绘制整个集合,而是将绘图从 x1 截断到 x2,即我知道的一些集合 x 值。我该怎么做?
我能想到的两个选项,如果你知道范围的索引,那么:
plot(x(x1:x2),y(x1:x2)); % here x1 and x2 are indices, not values
否则,您始终可以:
range=find(x>x1 & x<x2); % here x1 and x2 are actual values, you can use any other condition needed... plot(x(range),y(range))