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

Dear all,
suppose that we have x defined:
clc
x = linspace(1,4,7)
what is the pertinent code to capture point: x = 2?

Answers (1)

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

Categories

Tags

Asked:

on 21 Apr 2020

Answered:

on 21 Apr 2020

Community Treasure Hunt

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

Start Hunting!