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.

 Respuesta aceptada

Cris LaPierre
Cris LaPierre el 28 de Mayo de 2020
Editada: Cris LaPierre el 28 de Mayo de 2020
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 comentarios

Doug
Doug el 28 de Mayo de 2020
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 el 28 de Mayo de 2020
Thanks heaps Cris. Much appreciated.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 27 de Mayo de 2020

Comentada:

el 28 de Mayo de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by