What does this syntax mean? “yyy(1,1) logical = xxx”

2 vues (au cours des 30 derniers jours)
jie xu
jie xu le 29 Oct 2020
Modifié(e) : Steven Lord le 29 Oct 2020
I found such a syntax in the class definition of the built-in toolbox, but I don't know what it means.
What is the syntax? What does it mean?
Where can I find a comprehensive grammar explanation?
What does "(1,1)" mean?
What does "logical" stand for?
IsEarthCentered(1,1) logical = trackingScenario.DefaultIsEarthCentered;

Réponses (2)

Walter Roberson
Walter Roberson le 29 Oct 2020
It is a property name, size, datatype, and initial value.

Steven Lord
Steven Lord le 29 Oct 2020
Modifié(e) : Steven Lord le 29 Oct 2020
See this documentation page for information about the property validation syntax used in properties blocks inside a classdef file.
This line:
IsEarthCentered(1,1) logical = trackingScenario.DefaultIsEarthCentered;
means that any value you assign to the IsEarthCentered property must be a scalar (1-by-1) value that is logical or can be converted to a logical. If you don't set it, the default value of that property is the value of (what I suspect to be a Constant property of the trackingScenario class, based on the name) trackingScenario.DefaultIsEarthCentered.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by