Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Can anyone help with code for this problem

1 visualización (últimos 30 días)
Xanm ft
Xanm ft el 8 de En. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
How do you write code to find row/column of first time a number appears in matrix
Eg for [ 1 2 2; 3 3 5;6 6 7; 5 3 3;4 5 4]
The first time 4 appears is in the first column of the fifth row. Is there a way to code for this to solve this in a massive matrix?

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de En. de 2020
unique() with first and second outputs and 'first' option.
The first output will be a list of values. The second will be the corresponding linear index.
You might want to ind2sub() the linear indices.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by