What is the best way to display a large text file in MATLAB GUIDE?

后端 未结 3 1870
甜味超标
甜味超标 2021-01-03 11:34

How can a MATLAB GUIDE control be used to display the contents of a text file in a GUI? The text file may be very long or very wide so it should have the ability to have ver

3条回答
  •  余生分开走
    2021-01-03 12:04

    Here is my solution. Good Luck

    fid = fopen(filename);
    str = textscan(fid, '%s', 'Delimiter','\n'); str = str{1};
    fclose(fid);
    f=figure;
    hPan = uipanel(f,'Units','normalized');
    uicontrol(hPan, 'Style','listbox', ...
    'HorizontalAlignment','left', ...
    'Units','normalized', 'Position',[0 0 1 1], ...
    'String',str);
    

提交回复
热议问题