Finding elements according to indices from an array

1 次查看(过去 30 天)
Suppose,
x=[11 13 10 16 15 19 12 18 17 14]
y=[1 2 5 7 10]
I want to find the elements according to the indices presented in y.
The answer would be
[11 13 15 12 14]

采纳的回答

Image Analyst
Image Analyst 2022-1-17
x=[11 13 10 16 15 19 12 18 17 14];
y=[1 2 5 7 10];
theAnswer = x(y)
theAnswer = 1×5
11 13 15 12 14
Try looking at this:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Downloads 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by