Counting by 10
显示 更早的评论
Hey I need some help creating a code that is able to read a string in a text file and pull every 10th,20th,30th,40th,and so on and so forth. So I am currently trying to use the size function but isn't quite working. Any suggestions?
2 个评论
Image Analyst
2012-2-17
Pull every 10th, 20th, 30th, or 40th WHAT? Character from that string? Integer from that line of text? Line of text from that file? Are you using textscan(), fgets(), fgetl() or something else?
Frandy
2012-2-18
回答(1 个)
Jeff E
2012-2-17
0 个投票
blah = char(65:120)
tens = blah(10:10:end)
2 个评论
Frandy
2012-2-18
Image Analyst
2012-2-18
Were we supposed to know that???? Why haven't you given an example of what the lines of text look like in your file? Otherwise, if people even bother, you'll just get guesses like this. Have you considered using dlmread()?
类别
在 帮助中心 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!