Function which creates a vertical line (Heaviside or something) which has a double gap in it
1 view (last 30 days)
Show older comments
HC98 on 4 Jan 2023
Answered: Johannes Hougaard on 4 Jan 2023
I want to create a function which produces something like this where we have a vertical line which has a gap in it.
I have a feeling it'll involve heaviside functions but I'm not sure
John D'Errico on 4 Jan 2023
@HC98 Sorry, but what you want is not a (usable) function, at least not a single valued function. For some value of x, what is y?
Johannes Hougaard on 4 Jan 2023
I think this function will do what you like.
For your example you should put in approximately
x = 0.1;
gaps = [-1.1 -1;1 1.1];
width = 0.1;
But as I don't have your code for the remainder of the graph I've tested using the contourf(peaks) test code
fig_handle = figure;
axes_handle = axes;
x = 18;
gaps = [15.1 16.5;19.2 20.6];
linewidth = 0.2;
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!