Plot different Y values for certain range of X

4 次查看(过去 30 天)
Let's say I have:
X = [1:10];
Y = [10:20];
I want to plot Y vs X, but in the range of X=[5:10] I want Y values to be (Y+20). And have the same plot line for all.
How can I do it?

回答(1 个)

Jonas
Jonas 2022-5-7
you can just calculate the values before plotting
Y(X>=5 & X<=10)=Y(X>=5 & X<=10)+20;
  1 个评论
Paz Yedidim
Paz Yedidim 2022-5-7
It is for analyzing big amount of data, and I will have to a edit Y values in several ranges of X.
Is there a more suitable way for it?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by