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

조회 수: 3 (최근 30일)
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]

채택된 답변

Stephen23
Stephen23 2020년 8월 24일
편집: Stephen23 2020년 8월 24일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by