Lable dimensions of multidimensional array

Hi !
I have a 4D array of cells. each dimension corresponds to a variable defined in a loop
How can I assign lables to each dimension so that if the user want the data in B{1,2,19,5} index, they can call for example B{ 'range=4' , '4V' , '5A' , '3m' }
Thanks in advance!

Antworten (1)

Matt J
Matt J am 9 Jul. 2020
Bearbeitet: Matt J am 10 Jul. 2020

0 Stimmen

There is no quick way to enable this, I'm afraid. You would have too write your own customized data object type and provide a subsref method to process the indexing syntax that you want,

2 Kommentare

Mahla Bakhshi
Mahla Bakhshi am 13 Jul. 2020
Thanks for your answer. But I did not uderstand how to customize data objecting for 4D array ?
Matt J
Matt J am 13 Jul. 2020
This example may help, if you are determined to write your own class.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 9 Jul. 2020

Kommentiert:

am 13 Jul. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by