《健身软件课程设计.doc》由会员分享,可在线阅读,更多相关《健身软件课程设计.doc(48页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、通信建模与仿真课程设计文档 第 48 页 通信建模与仿真课程设计文档健身日记小 组 名: wingman 小组成员: 20138618 肖键 20138554 潘凌 20138614 周治杰 20138579 何朝云 2015年07月03日Communication Modeling and SimulationCourse Design DocumentationFitness diary Team Name: wingman Members: 20138618 xiaojian 20138554 panling 20138614 zhouzhijie 20138579 hezhaoyun
2、03.July. 2015摘 要健身是一种体育项目,尤指包括徒手或用器械的体操,体操可以增强力量、柔韧性,增加耐力,提高协调,控制身体各部分的能力,从而使身体强健。健身有诸多好处,经常健身可以美化身体外貌;提高适应性;巩固人与社会的联系;改进人的个性;改善身体姿势;延缓衰老过程;放松身体;有助于控制情绪消沉;有益于保持情感的稳定;可以得到良好的睡眠;使人能更有效地工作;能够很好地适应和应付生活中的紧张场面;使人们能从疲劳中尽快解脱出来;调节改善全身各系统器官的功能;重新调配全身的血液;改善全身的氧气供应;保持身体肌肉的体积和重量;给大脑提供更多的血液,使人精神更为活跃;防止心脏病、冠心病、癌症
3、和关节炎。如今随着人们生活水平的提高,人们对身体素质的重视程度也越来越高,如今喜欢健身的人越来越多,但是懂得健身的人却寥寥无几,去健身的能真正坚持下来的就更加的少,造成这种现象的原因一方面在于人们在短时间内无法不到自身身体的变化,另一方面在于市场上的健身软件仍然特别匮乏,私人健身教练一般人又难以承担,于是我们小组针对以上问题,运用MATLAB以及MATLAB GUI 知识自行设计编写一款集健身计划定制,健身动作范例,健身私人相册于一身的Wingman健身日记软件。关键词:健身 健身益处 MATLAB GUIAbstractFitness is a sport, especially inclu
4、ding unarmed or with instrument gymnastics, gymnastics can enhance the strength, flexibility, increase endurance, improve coordination and the ability to control the various parts of the body, so as to make the body strong. Exercise has many benefits, often exercise can beautify the physical appeara
5、nce; improve adaptability; consolidate the human and social contact; improved personality; improve posture; aging; relaxation; help control depression; beneficial to maintain emotional stability; to get good sleep can make people more effective; the work; can well adapt to and cope with the tense sc
6、ene in life; so that people can come out as soon as possible relief from fatigue; improve the systemic organ function; redeploy blood; improve the bodys oxygen supply; keep the volume and weight of the body muscles; provide more blood to the brain, make people the spirit is more active; prevent hear
7、t disease, coronary heart disease, cancer and arthritis. Now with the improvement of peoples living standard, people pay more attention to the physical quality is more and more high, more and more people like fitness fitness, but know how people are scanty, going to the gym can really persist even l
8、ess, reasons for the phenomenon is that people in a short time can not not to change their own body, on the other hand, the market is still lack of special fitness software, personal trainer of ordinary people and difficult to bear, so our group to solve the above problems, the use of MATLAB and MAT
9、LAB GUI knowledge to design a set of fitness program written, fitness movement examples, private fitness in a photo album “Wingman exercise diary “software.Key words: Fitness Fitness benefits GUI MATLAB目 录2015年07月03日1ABSTRACT41.绪论61.1 设计背景、目的及意义61.2 解决问题61.2.1 Gif图片播放61.2.2 相册问题61.3 研究思路61.3.1 量身计划定
10、制61.3.2 指导图片设计61.3.3 相册制作71.3.4 BGM选择72.设计过程72.1 根据需要实现的功能设计GUI界面82.2 各模块设计界面92.2.1 drawupaplan92.2.2 intelligenttrain102.2.3 privatephotoalbum112.2.4 select BGM122.3 分别编写各模块功能实现代码132.3.1 背景图片插入132.3.2 Gif图片播放132.3.3 BIM值计算142.3.4 计划文档调用142.3.5 音乐类型选择152.3.6 选择相册文件夹152.3.7 保存提醒162.3.8 相册查看162.3.9 定义
11、下一张173.总结与结论18主要研究结论18研究展望18参考文献19附 录20附录一201. 绪论1.1 设计背景、目的及意义Matlab是新兴的编程语言和可视化工具,它提供了非常强大的编写图形用户界面的功能,即GUI(Graphic User Interface)。考虑到现在的大学生整天都喜欢宅在寝室,我们希望做出一款软件,能够让同学们走出去,夺取呼吸一下外面的新鲜空气,而不是整天面对着电脑,就知道打游戏和看电影。所以我们小组决定用matlab的GUI功能做一个免费的,方便的健身软件,增强同学们的体质。另一方面,我们小组也希望通过这一次项目的身体力行,找出自己在matlab学习中的短板,找出
12、自己的不足,加以改正,也算是提升自己的能力吧。1.2 解决问题1.2.1 Gif图片播放由于windows系统本身对gif图片的播放就只有网页播放,既不方便,也不美观,于是我们就使用movie( F, 20, 2 )播放动图,使得动态图每秒播放2帧,重复播放20次即直观,又美观。1.2.2 相册问题在制作私人相册时,无法固定某个文件夹进行储存照片,无法依次 读取某个文件夹的照片,我们采用用户固定某个文件夹进行储存照片(但此方法 操作起来有些繁琐),关于照片查看,我们查阅相关资料,采用循环依次读入某个文件夹照片并依次显示,但此方法用户必须手动选择需查看文件夹中的一张照片)1.3 研究思路1.3.
13、1 量身计划定制我们先通过个组员的明确分工,去网上查找资料,制定好科学合理的健身计划,然后将其制作成简单明了的word文档,然后通过定义函数将button与word文档关联,实现一键调取健身计划表的功能。1.3.2 指导图片设计通过movie( F,* , * )函数实现可控频率,多次重复的播放1.3.3 相册制作通过一个单独建立的文件夹实现存储和读取1.3.4 BGM选择通过多个GUI界面的关联设计实现不同风格,不同歌曲的自由选择2. 设计过程2.1 根据需要实现的功能设计GUI界面2.2 各模块设计界面2.2.1 drawupaplan2.2.2 intelligenttrain2.2.3
14、 privatephotoalbum2.2.4 select BGM2.3 分别编写各模块功能实现代码2.3.1 背景图片插入2.3.2 Gif图片播放2.3.3 BIM值计算2.3.4 计划文档调用2.3.5 音乐类型选择2.3.6 选择相册文件夹2.3.7 保存提醒2.3.8 相册查看2.3.9 定义下一张3. 总结与结论主要研究结论通过本次的MATLAB课程GUI设计让我们对MATLAB尤其是其GUI设计的功能有了进一步的了解认识到了它功能的强大。在MATLAB简单的设计中了解了关于MATLAB图形用户界面的部分控件的使用方法利用MATLAB的GUI提供的很多实用的控件方便用于设计属于自
15、己的图形界面。同时增强了团队的合作能力和沟通交流能力。GUI设计的成功也让我们有了更多的自信设计更加高难度的课题。研究展望此次MATLABwingman健身日记的设计让我们看到MATLAB功能的强大功能,虽然此次设计在某些功能还未完美实现,比如在私人相册方面,我们不能固定某个文件夹进行储存读取,需要人工选择。在后续的设计研究中,我们会完善改进有瑕疵的功能及界面。我们想当此软件在功能和界面上完善后,会有很大的市场。当下的年轻人对健身的热爱以及上班族平时很少有时间锻炼使我们的软件有很大的市场。 参考文献1 Matlab语言及实践教程(第2版) 清华大学出版社、北京交通大学出版社出版2 3 4 附
16、录附录一 MENUfunction varargout = Matlab_menu(varargin)% MATLAB_MENU MATLAB code for Matlab_menu.fig% MATLAB_MENU, by itself, creates a new MATLAB_MENU or raises the existing% singleton*.% H = MATLAB_MENU returns the handle to a new MATLAB_MENU or the handle to% the existing singleton*.% MATLAB_MENU(CAL
17、LBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in MATLAB_MENU.M with the given input arguments.% MATLAB_MENU(Property,Value,.) creates a new MATLAB_MENU or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before Matlab
18、_menu_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to Matlab_menu_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUIDATA, GU
19、IHANDLES % Edit the above text to modify the response to help Matlab_menu % Last Modified by GUIDE v2.5 25-Jun-2015 23:28:16 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, Matlab_menu_OpeningFcn, .
20、gui_OutputFcn, Matlab_menu_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 EDI
21、T % - Executes just before Matlab_menu is made visible.function Matlab_menu_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
22、and user data (see GUIDATA)% varargin command line arguments to Matlab_menu (see VARARGIN) % Choose default command line output for Matlab_menuhandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes Matlab_menu wait for user response (see UIRESUME)% uiwait(handl
23、es.figure1); % - Outputs from this function are returned to the command line.function varargout = Matlab_menu_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
24、MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout1 = handles.output; % - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% ev
25、entdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(0,currentfigure,Matlab_drawupaplan); % - Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (se
26、e GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(0,currentfigure,Matlab_intelligenttrain); % - Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to
27、 pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(0,currentfigure,Matlab_selectBGM); % - Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject
28、handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(0,currentfigure,Matlab_privatephotoalbum); % - Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, h
29、andles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)winopen(C:UsersjianDesktopMATLAB()16_.avi); % - Executes during object creation, after setting all properties.function axes1_
30、CreateFcn(hObject, eventdata, handles)% hObject handle to axes1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns calledha=axes(units,normalized,position,0 0 1 1);uistack(ha,down)II=imread(2.jpg);image(II)colo
31、rmap redset(ha,handlevisibility,off,visible,off);% Hint: place code in OpeningFcn to populate axes1INTELLIGENTTRAINfunction varargout = Matlab_intelligenttrain(varargin)% MATLAB_INTELLIGENTTRAIN MATLAB code for Matlab_intelligenttrain.fig% MATLAB_INTELLIGENTTRAIN, by itself, creates a new MATLAB_INT
32、ELLIGENTTRAIN or raises the existing% singleton*.% H = MATLAB_INTELLIGENTTRAIN returns the handle to a new MATLAB_INTELLIGENTTRAIN or the handle to% the existing singleton*.% MATLAB_INTELLIGENTTRAIN(CALLBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in MATLAB_INTELLIGENTT
33、RAIN.M with the given input arguments.% MATLAB_INTELLIGENTTRAIN(Property,Value,.) creates a new MATLAB_INTELLIGENTTRAIN or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before Matlab_intelligenttrain_OpeningFcn gets called. An% unrecognized pro
34、perty name or invalid value makes property application% stop. All inputs are passed to Matlab_intelligenttrain_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modi
35、fy the response to help Matlab_intelligenttrain % Last Modified by GUIDE v2.5 26-Jun-2015 01:04:38 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, Matlab_intelligenttrain_OpeningFcn, . gui_OutputFcn,
36、 Matlab_intelligenttrain_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
37、% - Executes just before Matlab_intelligenttrain is made visible.function Matlab_intelligenttrain_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 s
38、tructure with handles and user data (see GUIDATA)% varargin command line arguments to Matlab_intelligenttrain (see VARARGIN) % Choose default command line output for Matlab_intelligenttrainhandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes Matlab_intelligen
39、ttrain wait for user response (see UIRESUME)% uiwait(handles.figure1); % - Outputs from this function are returned to the command line.function varargout = Matlab_intelligenttrain_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle
40、 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 structurevarargout1 = handles.output; % - Executes on button press in pushbutton10.function pushbutton10_Callback(hO
41、bject, eventdata, handles)% hObject handle to pushbutton10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)info = imfinfo(.gif);%W = info.Width;H = info.Height;W = W(1);H = H(1);len = length(info);figure(NumberTi
42、tle, off, ToolBar, none, Menu, none);pos = get(gcf, position);set(gcf, position, pos(1) pos(2) W H);set(gca, position, 0 0 1 1);hold on;for i = 1 : lenstr=sprintf(photo%d.jpg,i);Ii, map = imread(.gif, frames, i);imwrite(Ii,str,jpg);F(:, i) = im2frame(flipud(Ii), map);endmovie(F, 20,2); % - Executes on button press in pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% hObject handle to pushbutton11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)info = imfinfo(