I have a an array.I need to find its index value.How can i do that?

 Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 6 de Oct. de 2019
Editada: KALYAN ACHARJYA el 6 de Oct. de 2019

0 votos

>> array_data=2:3:30
array_data =
2 5 8 11 14 17 20 23 26 29
Case 1: I assumed you are looking for index value of specific element in the array, say 17
idx=find(array_data==17)
Case 2: for all array Elements
idx=1:length(array_data)
Hope it helps!

10 comentarios

Silpa K
Silpa K el 12 de Oct. de 2019
Is it possible to find the label value using this.
KALYAN ACHARJYA
KALYAN ACHARJYA el 12 de Oct. de 2019
Editada: KALYAN ACHARJYA el 12 de Oct. de 2019
label value means?
Can you elaborate with example?
Silpa K
Silpa K el 12 de Oct. de 2019
If I have a dataset that contain 137 rows.I need to find the label value of each row.
Image Analyst
Image Analyst el 12 de Oct. de 2019
Unfortunately you forgot to provide the example KALYAN asked for. Please do so.
What is the label of each row? Is the label of row 87, 87 and the label of row 123, 123? If each label is just the index (i.e. row number), you could do
labels = 1 : size(m, 1);
Silpa K
Silpa K el 12 de Oct. de 2019
I have the following dataset ,In this dataset 1 st column is the set of labels that corresponding to the row.I need th find the labels row by row.
Walter Roberson
Walter Roberson el 12 de Oct. de 2019
The first column contains 1s and 2s. I am not clear on what you mean by finding the labels row by row?
T = readtable('ECGFiveDays_TRAIN.xlsx','readvariablenames',false);
labels = T{:,1};
Silpa K
Silpa K el 12 de Oct. de 2019
Find the label of 1st row next finding the label of second row or finding label of a specific row.
Walter Roberson
Walter Roberson el 12 de Oct. de 2019
After the code I posted had been executed, the label of first row would be labels(1). The label of second row would be labels(2). The label of the K'th row would be labels(K).
Silpa K
Silpa K el 13 de Oct. de 2019
Thank you sir.
KALYAN ACHARJYA
KALYAN ACHARJYA el 13 de Oct. de 2019
Answer Credit Goes to @Walter Sir

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 6 de Oct. de 2019

Comentada:

el 13 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by