Meaning of the code cx, cy
10 views (last 30 days)
Show older comments
What does the code [cx, cy] mean/specifies when plotting a 2D circle? Where can I the definitions for such items on the MATLAB website or manuals? Thanks.
4 Comments
Steven Lord
on 3 Oct 2019
I agree with both of Adam's statements. The author of that example could have used many different identifiers for the output arguments of that function call:
% Animals
[aardvark, zebra] = circlefn(2.5);
% Randomly pressing keys
[giodfj, fojjfo] = circlefn(2.5);
% Indicate a lot of information about the code's origin
[lesson5_example_first_output, ...
lesson5_example_second_output] = circlefn(2.5);
But generally speaking, the more descriptive the name of the output argument the easier I find it to understand the code (within reason; no need to write a book when a word would do!)
cx and cy as the coordinates of the points on a circle seem reasonable, though if space on the page weren't an issue I might have used something slightly longer and more descriptive to disambiguate between the coordinates of the center of the circle and the coordinates of the points on the circle (both of which could reasonably be called cx and cy.)
[Xpoints, Ypoints] = circlefn(2.5);
Answers (0)
See Also
Categories
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!