- 积分
- 32
- 注册时间
- 2009-7-29
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2010-12-23 09:42:30
|
显示全部楼层
来自 湖南湘潭
统一按字符串数组处理,一行一行地写入txt文本即可。
- % --- Executes during object creation, after setting all properties.
- function con_CreateFcn(hObject, eventdata, handles)
- % hObject handle to con (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles empty - handles not created until after all CreateFcns called
- % Hint : edit controls usually have a white background on Windows.
- % See ISPC and COMPUTER.
- if ispc && isequal(get(hObject, 'BackgroundColor'), get(0, 'defaultUicontrolBackgroundColor'))
- set(hObject, 'BackgroundColor', 'white');
- end
- % --- Executes on button press in pb.
- function pb_Callback(hObject, eventdata, handles)
- % hObject handle to pb (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- str = get(handles.con, 'String')
- dir = handles.dir;
- fin = fopen(dir, 'wt');
- for k = 1:size(str, 1)
- fprintf(fin, '%s\n', str(k,:));
- end
- fclose(fin);
复制代码 |
评分
-
1
查看全部评分
-
|