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

3 visualizaciones (últimos 30 días)
Alireza Babaei
Alireza Babaei el 21 de Abr. de 2020
Respondida: Sriram Tadavarty el 21 de Abr. de 2020
Dear all,
suppose that we have x defined:
clc
x = linspace(1,4,7)
what is the pertinent code to capture point: x = 2?

Respuestas (1)

Sriram Tadavarty
Sriram Tadavarty el 21 de Abr. de 2020
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

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by