MATLAB: Textscan error – name-value pair arguments must come in pairs

textscan

Hi,
I keep getting the following error:
Error using textscan
Name-value pair arguments must come in pairs.
fid = fopen(char(name),'r');
disp(name);
line = fgetl(fid);
line = fgetl(fid);
EID = sscanf(line,'%s');
line = fgetl(fid);
line = fgetl(fid);
A = textscan(line,'%s','%\t');
FlEx = str2num(cell2mat(A{1,1}(5)))
line =
Fluorescence excitation wavelength (nm): 405
Does someone know how to solve this problem?

Best Answer

This line fails:
A = textscan(line,'%s','%\t');
What is the prupose of the two parameters? You did not explain them and they are not correct, therefore we cannot know the intention of the code.
The usage of textscan is explained exhaustively in the documentation:
doc textscan
If you do not understand some parts, please ask a specific question. Perhaps you want:
A = textscan(line, '%s', 'CommentStyle', '%', 'Delimiter', '\t');
But this is a guess only.