Meaning of the code cx, cy
Afficher commentaires plus anciens
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 commentaires
Adam
le 3 Oct 2019
It doesn't mean anything if it doesn't come with any context. At a guess if stands for centre x and centre y, but there's no universally accepted definition of [cx, cy] without any code or equation showing its usage!
Ricardo G
le 3 Oct 2019
Steven Lord
le 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);
Ricardo G
le 4 Oct 2019
Réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!