简体   繁体   中英

Accessing a List element from another List — MATLAB

I have a question. I have an list

L1 - {'a','b','c'} 
L2 - {'d','e','f'} 

I am storing the L1 and L2 in a separate list, so that I can loop through it ie

X - {'L1','L2'} 

Now, I am not able to do this operation X{1}{1}. Does any one know an alternative?

I need to access the element 'a'

To create the cell array of cells X , you need to write

X = {L1,L2};

Then you can access X{1}{1}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM