shuizhilei3334 2013-10-29 14:48 采纳率: 0%
浏览 5055

matlab字符串文本读入问题

下面是我需要读入的字符矩阵
F F T T Some $$$ F T French 0-10 T
T F F T Full $ F F Thai 30-60 F
F T F F Some $ F F Burger 0-10 T
T F T T Full $ F F Thai 10~30 T
T F T F Full $$$ F T French >60 F
F T F T Some $$ T T Italian 0-10 T
F T F F None $ T F Burger 0-10 F
F F F T Some $$ T T Thai 0-10 T
F T T F Full $ T F Burger >60 F
T T T T Full $$$ F T Italian 10~30 F
F F F F None $ F F Thai 0-30 F
T T T T Full $ F F Burger 30-60 T
我不知道用什么命令好,用textscan和textrean出现了下面的问题:
A=textread('sample.txt','%s %s %s %s %s %s %s %s %s %s %s');
Error using dataread
Number of outputs must match the number of unskipped input fields.

Error in textread (line 176)
[varargout{1:nlhs}]=dataread('file',varargin{:});
哪位大神能帮忙解答一下

  • 写回答

3条回答

  • IEET_121 2015-07-01 12:35
    关注

    [a, b, c, d, e, f, g, h, l, m,n] = textread('mf1.txt','%s %s %s %s %s %s %s %s %s %s %s')

    [a b c d e f g h l m n]

    ans =

    'F'    'F'    'T'    'T'    'Some'    '$$$'    'F'    'T'    'French'     '0-10'     'T'
    'T'    'F'    'F'    'T'    'Full'    '$'      'F'    'F'    'Thai'       '30-60'    'F'
        ..........
    
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?