Borrar filtros
Borrar filtros

how to find a certain coordinate value in a curve

1 visualización (últimos 30 días)
Adrian Ulza
Adrian Ulza el 7 de Abr. de 2017
Respondida: Star Strider el 7 de Abr. de 2017
Hi everyone, i need help.
Suppose i have a curve data as i attached. How do i find a B value that correspond to certain A value from that curve?
%%IMPORT OUTPUT FILE INTO MATLAB
load 'data.txt'
X=data(:,1);
Y=data(:,2);
A=max(X);
B=??
thanks for your help!

Respuestas (1)

Star Strider
Star Strider el 7 de Abr. de 2017
Ask the max function for two outputs. The second is the index of the first occurrence of the maximum in your vector, and use the index to define the corresponding value of ‘y’:
[A,idx] = max(X);
B = y(idx);

Categorías

Más información sobre Interpolation 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