I need to read a column from excel for example say I need to read user_id column from excel and the excel sheet is present in some other folder at desktop.after I read the column containing user_id's I need to search for a particular user_id. How do I do that ...?

 채택된 답변

Walter Roberson
Walter Roberson 2019년 3월 21일

0 개 추천

readtable() to get the data into place. strcmp() or ismember() the appropriate column of the table.

댓글 수: 3

Sajid Afaque
Sajid Afaque 2019년 3월 21일
I need to compare the user_id's with a specific user_id and return either 1 or 0 .how do I do that
If the user_id are numeric:
specific_user_id == YourTable.user_id
If the user_id are character vectors:
strcmp(specific_user_id, YourTable.user_id)
If you just need to know whether the specific ID is found at all:
ismember(specific_user_id, YourTable.user_id)
If you need to know whether it is found and where it was found and there is only at most one match:
[specific_was_found, idx] = ismember(specific_user_id, YourTable.user_id);
Sajid Afaque
Sajid Afaque 2019년 3월 21일
Thanks a lot walter

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

제품

릴리스

R2013b

질문:

2019년 3월 21일

댓글:

2019년 3월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by