Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

3D Arrays finding an address in a element

1 visualizzazione (ultimi 30 giorni)
jerry brackett
jerry brackett il 12 Feb 2019
Chiuso: MATLAB Answer Bot il 20 Ago 2021
given that an integer array has been declared in the following manner: int a[10] [3] [5]
its base address is 89 what is the address of element a[7] [2] [4] ?

Risposte (1)

Adam
Adam il 12 Feb 2019
doc ind2sub
doc sub2ind
will convert between n-dimensional subscripts and linear indices.
In Matlab that is. Your declaration of your variable suggests you are talking about C, but this is a Matlab forum so I assume that is just to tell us what the array is rather than actual code.

Community Treasure Hunt

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

Start Hunting!

Translated by