excel x & y
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!