How I can avoid alphabetical sorting of classdef property list in MATLAB doc?

3 views (last 30 days)
Saeid Jafari
Saeid Jafari on 11 May 2019
Consider the following simple calssdef:
classdef MSD
% Constructs a mass-spring-damper system.
% object mass in kg.
mass double
% spring stiffness.
stiffness double
% friction coefficient.
damping double
% Constructor
function obj = MSD(mass, varargin)
p = inputParser;
p.addParameter('stiffness', 0);
p.addParameter('damping', 0);
p.parse(mass, varargin{:});
obj.mass = p.Results.mass;
obj.stiffness = p.Results.stiffness;
obj.damping = p.Results.damping;
The order of property items in Command Window is the same as that in the code i.e.
  1. mass,
  2. siffness,
  3. damping.
>> mass = 10;
>> model = MSD(mass, 'stiffness', 1, 'damping', 2)
model =
MSD with properties:
mass: 10
stiffness: 1
damping: 2
Everything is OK so far. But in MATLAB doc, the property items are sorted in alphabetic order!!!
Is there any way to avoid alphabetic sorting of property items in MATLAB doc?
doc MSD

Community Treasure Hunt

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

Start Hunting!

Translated by