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

3 ビュー (過去 30 日間)
Alireza Babaei
Alireza Babaei 2020 年 4 月 21 日
回答済み: Sriram Tadavarty 2020 年 4 月 21 日
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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by