function varargout = data_process(varargin)
% DATA_PROCESS M-file for data_process.fig
% DATA_PROCESS, by itself, creates a new DATA_PROCESS or raises the existing
% singleton*.
%
% H = DATA_PROCESS returns the handle to a new DATA_PROCESS or the handle to
% the existing singleton*.
%
% DATA_PROCESS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in DATA_PROCESS.M with the given input arguments.
%
% DATA_PROCESS('Property','Value',...) creates a new DATA_PROCESS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before data_process_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to data_process_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help data_process
% Last Modified by GUIDE v2.5 08-Jul-2010 13:45:31
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @data_process_OpeningFcn, ...
'gui_OutputFcn', @data_process_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before data_process is made visible.
function data_process_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to data_process (see VARARGIN)
global flag;
flag=0;
set(handles.jisuan, 'enable', 'off')
set(handles.pushbutton6, 'enable', 'off')
set(handles.save, 'enable', 'off')
% Choose default command line output for data_process
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes data_process wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = data_process_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in data_input.
function data_input_Callback(hObject, eventdata, handles)
% hObject handle to data_input (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Test_Data
global Test1_Data;
global Test2_Data;
global Test3_Data;
global A;
global B;
global C;
global D;
global E;
global F;
global C1;
global D1;
global E1;
global F1;
global m;
global p;
global det;
global n;
global flag;
%----------------------------------%
%set(handles.edit13, 'enable', 'off')
%set(handles.edit14, 'enable', 'off')
%set(handles.edit15, 'enable', 'off')
%set(handles.edit16, 'enable', 'off')
%set(handles.edit17, 'enable', 'off')
%set(handles.edit18, 'enable', 'off')
%set(handles.edit19, 'enable', 'off')
%set(handles.edit20, 'enable', 'off')
%set(handles.edit21, 'enable', 'off')
%set(handles.edit23, 'enable', 'off')
%set(handles.edit24, 'enable', 'off')
%---------------------------------%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[filename,pathname,FILTERINDEX]=uigetfile({'*.dat';'*.txt';'*.*'},'');
if(FILTERINDEX==0)
return;
end
str_filename=[pathname,filename];
fid=fopen(str_filename,'rt');
if(fid==-1)
errordlg('Open file error!','Open error');
return;
end
mn=fscanf(fid,'%f');
Test1_Data=mn;
set(handles.input1data,'String',num2str(Test1_Data));
pause(0.05);
a=length(Test1_Data)-1;
Test2_Data=zeros(a,1);
for (i=1:a);
Test2_Data(i,1)=(Test1_Data(i+1,1)-Test1_Data(i,1))*0.000687;
end
set(handles.jiaoduzengliang,'String',num2str(Test2_Data));
set(handles.edit21,'String',num2str(a+1));
set(handles.jisuan, 'enable', 'on')
flag=0;
% --- Executes on button press in close.
function close_Callback(hObject, eventdata, handles)
% hObject handle to close (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close;
function input1data_Callback(hObject, eventdata, handles)
% hObject handle to input1data (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of input1data as text
% str2double(get(hObject,'String')) returns contents of input1data as a double
% --- Executes during object creation, after setting all properties.
function input1data_CreateFcn(hObject, eventdata, handles)
% hObject handle to input1data (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on button press in jisuan.
function jisuan_Callback(hObject, eventdata, handles)
% hObject handle to jisuan (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Test1_Data;
global Test2_Data;
global Test3_Data;
global A;
global B;
global C;
global D;
global E;
global F;
global C1;
global D1;
global E1;
global F1;
global m;
global p;
global det;
global n;
global G20;
global G21;
global flag;
A=zeros(10,1);
m=str2num(get(handles.edit4,'String'));
n=str2num(get(handles.edit5,'String'));
t=str2num(get(handles.edit6,'String'));
det=str2num(get(handles.edit7,'String'));
v=str2num(get(handles.edit8,'String'));
k=det/v;
p=det/t;
B=0;
for (i=0:9);
j=m+p*i;
A(i+1,1)=(Test1_Data(j+p,1)-Test1_Data(j,1))*0.000687;
if A(i+1,1)<-10;
A(i+1,1)=A(i+1,1)+360;
end
B=A(i+1,1)+B;
end
B=B/10;
C=B/det;
D=abs(C-v)/v;
temp=0;
F=0;
tp=zeros(10,1);
for (i=1:10);
temp=(A(i,1)-B)^2+temp;
tp(i,1)=abs((A(i,1)-B)/v);
end
temp=temp/9;
E=sqrt(temp)/(abs(B));
F=max(tp);
set(handles.listbox4,'String',num2str(A));
set(handles.edit13,'String',num2str(C));
set(handles.edit14,'String',num2str(D));
set(handles.edit15,'String',num2str(E));
set(handles.edit16,'String',num2str(F));
用matlab的gui编的处理实验数据的小程序
5星 · 超过95%的资源 需积分: 10 175 浏览量
2010-07-21
21:53:45
上传
评论 3
收藏 64KB RAR 举报
zhusun1985
- 粉丝: 0
- 资源: 2
最新资源
- week6.1.7z
- 移动机器人自主路径规划之RRTStar算法MATLAB实现代码
- 基于Python+OpenCV+FFmpeg实现自动识别电影剪辑+分析剪辑主题颜色+源码+文档(毕业设计&课程设计&项目开发)
- 基于python的二手商品交易平台 python+django开发的供需平台
- 微信小程序源码 侧滑布局小程序 (源码下载 +内附使用说明)
- heima-JUC-资料
- coreg_FSL.sh
- ROS+YOLOV8+SLAM智能小车导航实战(四、激光雷达+SLAM建图)
- 什么是决策树,有哪些适用场景?
- 基于python开发的口红色号识别程序+源码+开发文档+源码解析(毕业设计&课程设计&项目开发)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈