Lookup Table for Multi Variable Implicit Function or MATLAB Function

조회 수: 5 (최근 30일)
Orion
Orion 2014년 8월 5일
댓글: Sean de Wolski 2014년 8월 5일
In order to call the precalculated values of a multi-variable function can I use the Simulink n-D Lookup Table or is there a MATLAB function to do that? In part of my script I need to access an output of the function F(x,y,z)-unknown function- knowing the values for x,y,z. My cell arrays look like this:
x y z F
7 3 15 0.003
8 4 19 0.04
7 5 12 0.09
.
.
.
So I have the values for x,y,z and F columns independently. I know I can write an IF statement for x=x0,y=y0,z=z0 and find the row index and F but I am trying to use a faster way without having to go to through for/if loops. speed is an issue. Is there a MATLAB function for that? Thanks

답변 (1개)

Sean de Wolski
Sean de Wolski 2014년 8월 5일
Sounds like a use for scattered or gridded interpolants:
  댓글 수: 2
Orion
Orion 2014년 8월 5일
Thanks for the link but I guess my question is simpler than that. I am still using the known integer values for x,y,z. nothing different than the recorded values. like if all four columns are stored in table T, then I want T(7,3,15) returns 0.003.
Sean de Wolski
Sean de Wolski 2014년 8월 5일
Oh. Then use ismember with the 'rows'__ option
x = [1 2; 3 4; 5 6]
idx = ismember(x,[3 4],'rows')
F(idx)

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by