删除Matlab中两个特定数据点之间的线 [英] Removing the line between two specific data points in Matlab
本文介绍了删除Matlab中两个特定数据点之间的线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将在Matlab中绘制图形.该图非常简单,我正在使用绘图功能.
假设我要绘制的数据是(0:1:10)
.我还将标记放在图表上.然后,我们有一条在坐标(0,0),(1,1),(2,2),...
等上具有标记的线.
I am going to draw a graph in Matlab. The graph is quite simple and I am using the plot function.
Suppose the data that I want to plot is (0:1:10)
. I also put markers on my graph. Then, we have a line that has markers on coordinates (0,0),(1,1),(2,2),...
etc.
现在,我想删除(2,2)
和(3,3)
之间的行而不删除整个行.也就是说,我的目的是在不丢失整条线或任何标记点的情况下摆脱线的特定部分.
Now, I want to remove the line between (2,2)
and (3,3)
without deleting the whole line. That is to say, my purpose is to get rid of a particular segment of the line without loosing the entire line or any marker points.
我该怎么做?
推荐答案
尝试以下操作:
y = [0.2751 0.2494 0.1480 0.2419 0.2385 0.1295 0.2346 0.1661 0.1111];
x = 1:numel(y);
plot(x(1:4), y(1:4), '-x')
hold
plot(x(5:end), y(5:end), '-x')
这篇关于删除Matlab中两个特定数据点之间的线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文