Simulink: get range of values from lookup table

조회 수: 4 (최근 30일)
jp
jp 2019년 3월 4일
답변: Fangjun Jiang 2019년 3월 6일
In Simulink, I have a 1-D lookup table containing data with evenly-spaced breakpoints. I want to compute the mean of the table data between two points. Is it possible to do this?
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2019년 3월 5일
not clear what you actually want to do. example?
jp
jp 2019년 3월 5일
For example, if the table data is [1 2 3 4 5 6 7 8 9 10], and I have calculated the start and end points to be 3 and 6, I need to be able to get [3 4 5 6] out.

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

채택된 답변

Fangjun Jiang
Fangjun Jiang 2019년 3월 6일
TableData=1:10;
dStart=3;
dEnd=6;
index=and(TableData>=dStart, TableData<=dEnd);
SelectedData=TableData(index)
SelectedData =
3 4 5 6

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by