Discussion Overview
The discussion revolves around a MATLAB plotting issue where a user is attempting to plot a series of cost values against a range of radius values but is only seeing a single point on the graph. The conversation includes troubleshooting the code and exploring different coding approaches to achieve the desired plot.
Discussion Character
- Technical explanation
- Debate/contested
- Mathematical reasoning
Main Points Raised
- One participant shares their code and expresses frustration that the plot only shows one point instead of a line.
- Another participant suggests that the issue is due to the lack of an index and provides a modified version of the code, emphasizing the use of element-wise operations.
- A subsequent participant encounters a matrix dimension error when trying the suggested code and seeks further assistance.
- Another participant proposes a similar code structure but asks if it resolves the issue.
- One participant recommends adding "figure; hold on" before the loop to allow multiple points to be plotted without overwriting previous points.
- Another participant critiques this approach as inefficient and expresses concern about CPU usage, suggesting it is poor coding practice.
- A later reply reiterates the critique of the original plotting method and compares the execution time of both approaches, highlighting minimal differences in performance.
Areas of Agreement / Disagreement
Participants express differing opinions on the efficiency of the coding methods proposed. While some suggest modifications to resolve the plotting issue, others argue about the implications of those methods on performance and coding standards. No consensus is reached regarding the best approach.
Contextual Notes
Participants mention the importance of using element-wise operations in MATLAB, but there is no agreement on the best coding practices or the most efficient way to achieve the desired plotting outcome.