Inside input formats, any character which is given literally is a character that is to be matched against in input, and discarded when found. For example if you had a format of '%c<%c>' then the '<' and '>' would have to appear in the input and would be "eaten" and thrown away. The space character is not special in this regard (but it can often look like it because spaces and tabs and newlines at the beginning of a field are ignored for all formats other than %c and %[ )
fscanf problem
1 次查看(过去 30 天)
显示 更早的评论
hello, this is a very simple problem. but i cant figure it out. i have a text file. it contains a line
'read this line'.
when i write a=fscanf(fid,'%c') it shows
a= read this line.
but when i write
a=fscanf(fid,'%c '),
with a space after %c, it shows
a=readthisline.
what happens when i put that space?
-obli
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!