Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how to properly textscan

1 Ansicht (letzte 30 Tage)
Matthew Perry
Matthew Perry am 25 Nov. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Michal
Michal am 25 Nov. 2019
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.

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by