How to create a function which takes one column of data as its input and another as its output
조회 수: 2 (최근 30일)
이전 댓글 표시
I have two columns of data and need to come up with a function that take as input the values from the first column of data and outputs the corresponding values in the second column. There is no equation that links the columns together they are just two lines of data. How would I go about coming up with a function that enables me to input a value from the first column and be given the corresponding value in the second?
댓글 수: 2
Dyuman Joshi
2023년 2월 27일
"... outputs the corresponding values in the second column."
You want to store the output in the second column, over-writing the values present there?
채택된 답변
David Hill
2023년 2월 27일
댓글 수: 3
Stephen23
2023년 2월 27일
Logical indexing is simpler than FIND:
rng(1)
A = randi(100,10,2)
V = 88;
Z = A(A(:,2)==88,1)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!