How to select a specific point in a linearly spaced vector?

3 次查看(过去 30 天)
Dear all,
suppose that we have x defined:
clc
x = linspace(1,4,7)
what is the pertinent code to capture point: x = 2?

回答(1 个)

Sriram Tadavarty
Sriram Tadavarty 2020-4-21
Hi Alireza,
You can perform find operation
find(x==2); % This value tells the index in x where the value is 2
Hope this helps,
Regards,
Sriram

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by