I have a vector called collection with some elements: collection = [1 2 3 4 5 6 7 8 9 0]; I also have a variable called x that stores the string 'collection' x = 'collection'; I would like to know how can I plot the values of the vector 'collection' by using the variable x that has the name of the vector stored inside it. I would like to do something like this: plot(x) and that the points from the vector collection get plotted.
Prashant Kumar answered .
2025-11-20
Data.collection=1:10; x='collection'; plot(Data.(x))