필터 지우기
필터 지우기

Reading a specific number from array/table?

조회 수: 7 (최근 30일)
Damir
Damir 2016년 2월 17일
댓글: Ashish Sheikh 2016년 2월 18일
Hi!
I have this table from excel,
d[mm] stands for diameter in [mm], b1 is the coefficient for diameter. I want to create a script, in which I specify diameter d in [mm], and the the result is the coefficient from the second row. For example; d=40 -> (b1)=1,03
Thanks for your help!

채택된 답변

Ashish Sheikh
Ashish Sheikh 2016년 2월 17일
If you are importing excel data which is like 2 x 9 matrix ...
if A is 2 x 9 array ... d =60 ( for which the coefficient to be found,) then
z=find(A(1,:)==d); y=A(2,z) ; % y is the coefficient
Enter the number to be searched as d and y is the coefficient
  댓글 수: 2
Damir
Damir 2016년 2월 18일
Thank you very much!
How about if d is somewhere in the middle, like d=33, then I want to pick the closest highest and lowest number from row 1 an use linear interpolation to determine b1 for d=33.
Example: d=33 -> 30 (b1=1.09) and 40 (b1=1.03) -> linear interpolation; 33 b1=1.072
Ashish Sheikh
Ashish Sheikh 2016년 2월 18일
Do you mean that.. you want to round off the number and then perform linear interpolation ????

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by