how to add labels to the elements of a vector.
Show older comments
hello, everything okay?
Is it possible to label the elements of a vector? To later know in what position is it at a certain moment?
for exemple:
A=[4, 6 ,8 ,14, 90 ] (A contains the vector information set let's say A1 and A2, when A1=[4, 6 ,90] and A2=[8, 14])
Assign the position indices of each element of the vector. LabelA1=[1, 2,5] LabelA2=[3 ,5] LabelA=[ 1, 2,3,4,5]
if I do determine tasks with the vector and it looks like this A=[0 6 8 0 9 ] in another word A(1)=0 and A(4)=0
so A=[ 6 8 9 ] . LabelA1(1)=0 and LabelA2(1)=0 implies that LabelA1=[2,5] LabelA2=[5]
I need to find from the labels that of A1 A2 the position it occupies after updating vector A.
thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!