Search Table for value using other variables

I am wanting to pull out and manipulate a value from the below table.
Using P1, P4 and P7 to output the value from P8.
Help would be appreciated with this issue.

 채택된 답변

Cris LaPierre
Cris LaPierre 2020년 5월 28일
편집: Cris LaPierre 2020년 5월 28일

0 개 추천

ind = t.P1==48.3 & t.P4==16 & t.P7==44.79;
valP8 = t.P8(ind)
Of course you'll have to use the actual table and full variable names from your table.

댓글 수: 3

Doug
Doug 2020년 5월 28일
Hey Cris,
Thanks for the answer, big help.
Can you also help me with adding the P8 value to another table?
t2.varName = t.P8;
Just keep in mind that t2 will have to have the same number of rows as t.
Doug
Doug 2020년 5월 28일
Thanks heaps Cris. Much appreciated.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2020년 5월 27일

댓글:

2020년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by