您的位置:首页 > 编程语言 > MATLAB

matlab GUI读取G代码在Edit,多行显示显示

2015-10-26 15:28 337 查看
在perprosprity 里面::设置max min,可以进行对行显示

否则和消失。

按钮点击打开文件:

然后再edit显示出代码

[filename pathname]=uigetfile({'*.txt','txt-file(*.txt)';'*.*','All the files(*.*)'},'Choose a file');

if isequal(filename,0)||isequal(pathname,0);

h=msgbox ('Please choose a file!','Warning','warn');

return;

else

% [FileName,PathName] = uigetfile('*.KGF','Select the Data file');

path2=fullfile(pathname,filename)

fidin=fopen(path2); %打开文件

if ~feof(fidin)

tline=fgetl(fidin);

str=[tline,10]

end

while ~feof(fidin)

tline=fgetl(fidin);

str1=[tline,10]

str=[str,str1]

end

set(handles.editCode,'string',str1)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: