retrieving data from excel sheet

how can I search a name in the excel sheet column, the code should return the 0 or 1, or found or not found.

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Jul. de 2020

0 votos

readtable() the needed columns. ismember() the desired name with the table column variable as the second parameter.
Note: if you are doing that "distance between cities" exercise then you will have more work than I described above, because of the header line

4 comentarios

abdul rehman
abdul rehman el 14 de Jul. de 2020
thank, but its returning text as NaN. only number is being displayed. can you help
Walter Roberson
Walter Roberson el 14 de Jul. de 2020
if you are doing the distance assignment then xlsread and take the third output.
Note that for that assignment you need to know where the match is, not just whether there is a match.
abdul rehman
abdul rehman el 14 de Jul. de 2020
Actually, Sorry i am unable to clearify you. The issue is that the is stored in excel file is showing as NaN means noting or empty cell, when i retrive using xlsread or readtalbe.
[~, ~, raw] = xlsread('TheFileName.xlsx');

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 14 de Jul. de 2020

Comentada:

el 14 de Jul. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by