电力系统GUI界面简易教程.doc

上传人:re****.1 文档编号:544733611 上传时间:2023-11-05 格式:DOC 页数:4 大小:131.50KB
返回 下载 相关 举报
电力系统GUI界面简易教程.doc_第1页
第1页 / 共4页
电力系统GUI界面简易教程.doc_第2页
第2页 / 共4页
电力系统GUI界面简易教程.doc_第3页
第3页 / 共4页
电力系统GUI界面简易教程.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《电力系统GUI界面简易教程.doc》由会员分享,可在线阅读,更多相关《电力系统GUI界面简易教程.doc(4页珍藏版)》请在金锄头文库上搜索。

1、1.仿真图 在仿真界面画出仿真图并保存为:zengyisina.m2.画GUI界面 3.编写M文件,详细的注释如代码,自己要写的部分很少,大多是系统自动生成的代码。function varargout = zengyi(varargin)% ZENGYI MATLAB code for zengyi.fig% ZENGYI, by itself, creates a new ZENGYI or raises the existing% singleton*.% H = ZENGYI returns the handle to a new ZENGYI or the handle to% the

2、 existing singleton*.% ZENGYI(CALLBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in ZENGYI.M with the given input arguments.% ZENGYI(Property,Value,.) creates a new ZENGYI or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the

3、 GUI before zengyi_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to zengyi_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUI

4、DATA, GUIHANDLES % Edit the above text to modify the response to help zengyi % Last Modified by GUIDE v2.5 02-Dec-2012 14:20:08 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, zengyi_OpeningFcn, . gu

5、i_OutputFcn, zengyi_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT % - E

6、xecutes just before zengyi is made visible.function zengyi_OpeningFcn(hObject, eventdate, 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 (se

7、e GUIDATA)% varargin command line arguments to zengyi (see VARARGIN)axes(handles.axes1);X=imread(tuxing.bmp,bmp);image(X)axis off;% Choose default command line output for zengyihandles.output = hObject;% Update handles structureguidata(hObject, handles); % UIWAIT makes zengyi wait for user response

8、(see UIRESUME)% uiwait(handles.figure1); % - Outputs from this function are returned to the command line.function varargout = zengyi_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined

9、in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout1 = handles.output; function edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined

10、in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,String) returns contents of edit1 as text% str2double(get(hObject,String) returns contents of edit1 as a double % - Executes during object creation, after setting all properties.function ed

11、it1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (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 COMP

12、UTER.if ispc & isequal(get(hObject,BackgroundColor), get(0,defaultUicontrolBackgroundColor) set(hObject,BackgroundColor,white);end % - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to

13、 be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)open zengyisina;%调用系统的open函数打开文件set_param(zengyisina/Gain,Gain,get(handles.edit1,string);/设置仿真系统中的参数。 % - Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, han

14、dles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)sim(zengyisina);/系统开始仿真 figure;/打开一个画图界面。plot(A1(:,1),A1(:,2);plot(handles.axes2,A1(:,1),A1(:,2);%plot(A1(:,1),A1(:,2);4.运行仿真 可以通过改变增益的数值,先点击保存参数,后再点击开始仿真,仿真出来的波形显示在上面的窗口中。 此做了一个简单的GUI界面,其中包括图片的显示,参数的设置,如何把GUI界面把仿真中的参数设置和仿真运行及波形的显示联系起来等方法。可以举一反三运用到电力系统仿真GUI界面的制作中。

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号