Reputation: 327
How I can give two ranges of x for a plot, for a simple example considering x=0:0.5:50;
and x=50:10:1000;
y=x.^2
plot(x,y)
Upvotes: 1
Views: 52
Reputation: 44
If I understand your problem right, this might be a solution:
x = [0:0.5:50, 50:10:1000];
y = x.^2;
plot(x,y);
Upvotes: 1
Reputation: 603
I didn't get the question. Please explain exactly what you need.
If your aim is to concatenate two plots you can simply compute y in the two interval separately.
x=0:0.5:50;
y=x.^2;
plot(x,y);
hold on
x=50:10:1000;
y=x.^2;
plot(x,y)
Upvotes: 0