Meaning of the code cx, cy

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
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
Ricardo G le 3 Oct 2019
Hello Adam,
Thank you for your response. I believe your guess is correct. And you are in the right, I should have placed my question in context. I'm trying to learn MATLAB from the book Getting Started with MATLAB by Rudra Pratap ( I'm quessing you are probably familiar with the book). My question stemmed from chapter 2, lesson 5 of the book, creating and excuting function files. I've included two screen captured attachments, one is the function file code and the other on how to execute the function file. I hope this will give some background to my question. Again, thank you Adam and to all others.
Cheers,
Ricardo
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
Ricardo G le 4 Oct 2019
Hi, Steven Lord,
Thank you. I believe you just made that section/lesson of the book I'm using clearer; and, further, the rest of the book! Now, I will not be as concern as to WHY the author assigned a variable/function a particular name ( as you said, he can have named them anything: aardvark, zebra).
Regards,
Ricardo

Connectez-vous pour commenter.

Réponses (0)

Commenté :

le 4 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by