MATLAB: How to plot the figure

plotting

if true
% code
end

Best Answer

Is this homework?
Just use an two sets of code for the two ranges.
% First do the left range.
r1 = linspace(0, a, 500); % 500 points from 0 to a
z1 = ...your formula
plot(r1, z1, 'b-', 'LineWidth', 2);
% First do the right range.
r2 = linspace(a, 3, 500); % 500 points from a to 3
z2 = ...your formula
hold on;
grid on;
plot(r2, z2, 'b-', 'LineWidth', 2);
% Plot dashed line
line([1, 1], ylim, 'LineStyle', '--', 'Color', 'k');