extract data from cell array based on matching numbers with location in array

1 vue (au cours des 30 derniers jours)
Hi I have a cell array MyData which has 128x1 cells with data running sequentially from A1 to A32 and again for B1-B32, C1-C32 and D1-D32. Can anyone advise how I extract data from this array based on whether the location in this array matches that of a number? For example, if I have A how do I get the desired output B?
MyData = [sprintfc('A%i',1:32) sprintfc('B%i',1:32) sprintfc('C%i',1:32) sprintfc('D%i',1:32)]'
A = [1 34 68 92 118]'
B =[A1 B2 C4 C28 D22]

Réponse acceptée

Stephen23
Stephen23 le 24 Août 2020
Modifié(e) : Stephen23 le 24 Août 2020

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by