Borrar filtros
Borrar filtros

How to search a element or a number in lookup table

3 visualizaciones (últimos 30 días)
Reddy
Reddy el 5 de Jul. de 2012
hi, How to make a LUT of 2-dimensional, and also how to search a number or an element in the developed lookup table by using simple matlab commands( not using simulink preferably)?
thanks, sridhar
  2 comentarios
the cyclist
the cyclist el 5 de Jul. de 2012
There are many possible approaches to making something like a lookup table in MATLAB. I suggest you add significant more detail to your question, so that we can narrow the suggestions we might make.
Reddy
Reddy el 6 de Jul. de 2012
Editada: Walter Roberson el 7 de Jul. de 2012
thanks for replying my question....
suppose assume the following lookup table as an example.
deg sine_value cosine_value;
0 0 1;
30 0.5 0.866;
45 0.707 0.707;
60 0.866 0.5 ;
90 1 0;
with the above lookup table as reference, i need to locate a sine_value first, and then i need to search for cosine value which matches with the row of sine_value. After both the values are retrieved then, the corresponding angle should able to retrieved in the angle column.
for example: first a search is made to find a value 0.5 in sine_value column, then a search is made to find a value 0.866 in cosine_value column. if both lies in same row then, the corresponding value in the angle column is retrieved...
can u please help me how to develop this logic in mat lab( using simple mat lab commands).

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 7 de Jul. de 2012
[mindiff, row] = min( (YourTable(:,2) - V1).^2 + (YourTable(:,3) - V2).^2 );

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by