필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to properly textscan

조회 수: 1 (최근 30일)
Matthew Perry
Matthew Perry 2019년 11월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
Can someone please fully explain textscan function as i am new to matlab and am unsure what some of the code already on this forum means?
I am trying to make a search tool that relates a user input to a row in an imported table.
I want the user to type an input and using that input, the script relates it to a previous matrix to display that row's information.
eg; if my table is:
age initials gender
25 am F
32 dp m
and I type as my input "am"
I want to text scan in my table for "am" and display: 25 / F for exapmle??
  댓글 수: 1
Michal
Michal 2019년 11월 25일
If you have the table already imported you do not need to use textscan. Provided that the user always inputs initials you can find the corresponding info like this:
ind = find(strcmp(t.initials,user_input)); % locate the initials that the user wants; t is the table
if ~isempty(ind) % checking whether the initials were found at all
t(ind,:) % show the row that contains the initials
end
You would typically use textscan to scan through files or chunks of text.

답변 (0개)

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by