I want to use lookup table(LUT) with two entries i.e. m and error (with respect to m). Later, I want to fetch stored error from LUT by m values. Any one please suggest me ?

조회 수: 4 (최근 30일)
Two entries for lookup table are:
m = [0.01 0.1 0.2 0.5 1 2 5 10 100];
error = [0.1229 1.2106 2.3099 4.0651 0 -4.0651 -2.3099 -1.2106 -0.1229];
Later, i want to fetch error value with respect to m.
For example: for m=0.1, error(m)=1.2106.
Anyone please suggest me some idea??

채택된 답변

Seth Furman
Seth Furman 2023년 3월 7일
Consider dictionary.
m = [0.01 0.1 0.2 0.5 1 2 5 10 100];
err = [0.1229 1.2106 2.3099 4.0651 0 -4.0651 -2.3099 -1.2106 -0.1229];
d = dictionary(m,err)
d =
dictionary (doubledouble) with 9 entries: 0.0100 ⟼ 0.1229 0.1000 ⟼ 1.2106 0.2000 ⟼ 2.3099 0.5000 ⟼ 4.0651 1 ⟼ 0 2 ⟼ -4.0651 5 ⟼ -2.3099 10 ⟼ -1.2106 100 ⟼ -0.1229
d(.1)
ans = 1.2106

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by