excel x & y

조회 수: 7 (최근 30일)
Alireza Lashgary
Alireza Lashgary 2016년 8월 4일
댓글: Alireza Lashgary 2016년 8월 4일
Hi there i read two columns from an excel file. first column is x and second is y. i get x from user , how can a i find y for that x?
for example user inputs 0.531 i must show 0.5103 or user inputs 0.536 i must show 0.5154
my matrix is 2x1000 ( 2 columns and 1000 rows) please help

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 4일
편집: Azzi Abdelmalek 2016년 8월 4일
If M is your matrix
M=[0.5310 0.5103;0.5320 .5080;0.5330 0.5144]
x=0.5310
idx=ismember(M(:,1),x)
y=M(idx,2)
  댓글 수: 1
Alireza Lashgary
Alireza Lashgary 2016년 8월 4일
thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by