Extra Horizontal Line Across Origin in Figure 10.3 Due to Vector Concatenation in Exercise 10.1 (Pages 343–344)

Open Beginner friendly
#251 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
documentation

Research direction

Read Exercise 10.1 on pages 343–344 and locate the Figure 10.3 plotting code in the repository’s MATLAB materials. Check how the vectors are concatenated in the plot call; the issue identifies the unwanted segment along y = 0 and suggests corrected plotting forms. Done when the six subplots show the contour without the horizontal line across the origin.

Written by the indexing model from the issue text.

Description

Dear Professors,

reviewing Exercise 10.1 and Figure 10.3 on pages 343–344, I noticed a small plotting bug in the code that draws an unwanted horizontal blue line along $y = 0$ across all six subplots:

image
  • On page 343 (line 8), concatenating [x;x] and [y; -y] inside plot([x;x], [ y; -y]); connects the end of the upper branch (x = 2, y = 0) directly to the start of the lower branch (x = -2, y = 0) with a straight segment along the x-axis (visible in blue over the grey yline(0) in every subplot of Figure 10.3 on page 344).
image
  • Using plot([x; flipud(x)], [y; -flipud(y)]); (or plotting the two branches separately as plot(x, y, x, -y);) closes the contour cleanly without crossing the interior.

thanks, as always, for the time

Dominant language
MATLAB
Stars
30
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from UniprJRC/DSwithMATLAB

All issues in UniprJRC/DSwithMATLAB

Similar issues

More MATLAB issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.