Find values in a vector or function

버전 1.5 (1.69 KB) 작성자: Adrian Lara-Quintanilla
For a function y=f(x), this script looks for all the "x" values for a desired value of "y" (y0).
다운로드 수: 597
업데이트 날짜: 2014/11/19

라이선스 보기

Given a desired value "y0", this function finds all the elements "y" in a vector whose values are the closest to "y0" in the whole vector, and also the positions "xi". So, the output is a set of points [xi,y0] given in two vectors, one for the values and another one for the positions.
The inputs are:
-Vector.
-Value that you want to find in the vector "y0".

The outputs are:
-The closest values to "y0" in the function (by means the real "y" values).
-The position "xi" of those "y" values.

I hope it is useful for all of you. If you have any suggestion, please, tell me.

인용 양식

Adrian Lara-Quintanilla (2024). Find values in a vector or function (https://www.mathworks.com/matlabcentral/fileexchange/31103-find-values-in-a-vector-or-function), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.5

toolbox

1.4.0.0

Yields the closest value in case that the wanted value is not in the range of the input vector

1.3.0.0

Little optimization

1.1.0.0

The algorithm remains being the same, but I have made some little changes.
- When the function starts, it will ask for the value that you are looking for.
- It draws a plot to help you to understand the values and positions that the function found.

1.0.0.0