Documentation about multi-line array (matrix) definition?

I found that I can use multi-line matrix literals. That is,
A = [1 2; 3 4; 5 6] % This is the common form we use. In a single line.
is the same as
A = [1 2
3 4
5 6] % Using multiple lines
This also applies to cell arrays.
However, I cannot find any documents about this.
Matrix tutorial https://www.mathworks.com/help/matlab/learn_matlab/matrices-and-arrays.html does not say about ths multi-line array creation.
Is there any documentation about this? Is this usable to all previous versions?

 Respuesta aceptada

madhan ravi
madhan ravi el 15 de Mayo de 2019

8 comentarios

Taejun Jang
Taejun Jang el 15 de Mayo de 2019
Editada: madhan ravi el 15 de Mayo de 2019
I cannot infer that
A = [1 2
3 4
5 6]
is syntactically valid from this page. What I can see from this page is
A = [1 2; ...
3 4; ...
5 6]
is syntactically valid.
madhan ravi
madhan ravi el 15 de Mayo de 2019
Editada: madhan ravi el 15 de Mayo de 2019
Why the obsession?, if I may.
Taejun Jang
Taejun Jang el 15 de Mayo de 2019
Editada: Taejun Jang el 15 de Mayo de 2019
Because I am not sure from which version MATLAB supports this syntax.
Official documents usually do not use this syntax, except some toolboxes.
madhan ravi
madhan ravi el 15 de Mayo de 2019
Editada: madhan ravi el 15 de Mayo de 2019
Doesn't it work for older versions? Ok, as far as I surfed couldn't find it , perhaps it's undocumented.
Taejun Jang
Taejun Jang el 15 de Mayo de 2019
Editada: Taejun Jang el 15 de Mayo de 2019
I assume that this will work for older versions, but I haven't tried since I don't have one installed.
Thanks for the help.
madhan ravi
madhan ravi el 15 de Mayo de 2019
Editada: madhan ravi el 15 de Mayo de 2019
If you're so curious about this maybe you can try to contact the technical team and dig out some infos if plausible. If that infact happens please get back.
As a note, I contacted the technical support, and they replied as follows:
  • ... We have confirmed that this behavior is indeed undocumented. On that note, I will be creating an enhancement request to our documentation team and they may implement it for one of our future updates based upon internal discussions. ...
  • ... this undocumented feature is stable and there are no plans as of now to remove it in our future releases. ...
Thank you for following.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Productos

Versión

R2019a

Preguntada:

el 15 de Mayo de 2019

Comentada:

el 20 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by