风速等级转换计算器MATLAB

  • b5_185304
    了解作者
  • 19.5KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 12:15
    上传日期
风速等级转换计算器MATLAB设计,分别有KM/H与M/S;设计的有GUI可以直接输入,然后转换为等级。
风速转换.zip
  • 风速转换
  • fengsu.fig
    17.3KB
  • fengsu.m
    8KB
内容介绍
function varargout = fengsu(varargin) % FENGSU MATLAB code for fengsu.fig % FENGSU, by itself, creates a new FENGSU or raises the existing % singleton*. % % H = FENGSU returns the handle to a new FENGSU or the handle to % the existing singleton*. % % FENGSU('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in FENGSU.M with the given input arguments. % % FENGSU('Property','Value',...) creates a new FENGSU or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before fengsu_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to fengsu_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 % Edit the above text to modify the response to help fengsu % Last Modified by GUIDE v2.5 09-Oct-2020 11:38:46 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @fengsu_OpeningFcn, ... 'gui_OutputFcn', @fengsu_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 fengsu is made visible. function fengsu_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 fengsu (see VARARGIN) % Choose default command line output for fengsu handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes fengsu wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = fengsu_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; function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (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 edit1 as text % str2double(get(hObject,'String')) returns contents of edit1 as a double % --- Executes during object creation, after setting all properties. function edit1_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 COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (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 edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double % --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (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 function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (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 edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double % --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (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 function edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (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 edit4 as text % str2double(get(hObject,'String')) returns contents of edit4 as a double % --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles) % hObject handle to edit4 (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 pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) s1 = get(handles.edit1,'string');%СʱÿʱKM/H s1=str2num(s1); %% if s1<1 S11=0; elseif s1>=1&s1<=5 S11=1; elseif s1>=6&s1<=11 S11=2; elseif s1>=12&s1<=19 S11=3; elseif s1>=20&s1<=28 S11=4; elseif s1>=29&s1<=38 S11=5; elseif s1>=39&s1<=49 S11=6; elseif s1>=50&s1<=61 S11=7; elseif s1>=62&s1<=74 S11=8; elseif s1>=75&s1<=88 S11=9; elseif s1>=89&s1<=102 S11=10; elseif s1>=103&s1<=117 S11=11; elseif s1>117 S11=12; end set(handles.edit3,'string',S11) % --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % 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) s2 = get(handles.edit2,'string');%m/s s2=str2num(s2); %%M/s if s2<=0.2 fengsu2=0; elseif s2>=0.3&s2<=1.5 fengsu2=1; elseif s2>=1.6&s2<=3.3 fengsu2=2; elseif s2>=3.4&s2<=5.4 fengsu2=3; elseif s2>=5.5&s2<=7.9 fengsu2=4; elseif s2>=8.0&s2<=10.7 fengsu2=5; elseif s2>=10.8&s2<=13.8 fengsu2=6; elseif s2>=13.9&s2<=17.1 fengsu2=7; elseif s2>=17.2&s2<=20.7 fengsu2=8; elseif s2>=20.8&s2<=24.4 fengsu2=9; elseif s2>=24.
评论
    相关推荐
    • matlab 课件
      matlab 功能很强大,本课件详细的介绍了matlab在科学计算中的应用。
    • Matlab教程
      MatlaB经典ppt,主要讲解了MatlaB的入门知识,图形编程以及仿真。
    • matlab入门
      matlab的入门教程,很值得仔细看看,对提高matlab能力有帮助
    • matlab编译器
      matlab编译为exe文件所需要的文件; 使用时解压,将解压后文件拖入至matlab命令行即可
    • matlab
      matlab的基础知识进行介绍
    • MatLab
      “#MatLab
    • MATLAB编译器
      基于MATLAB 2018b版本介绍MATLAB编译器。介绍如何利用编译器将MATLAB代码编译为独立应用程序或组件,并在没有安装MATLAB的计算机上进行部署。
    • MATLAB 论文
      基于MATLAB的论文撰写!可以为你指明一条写作MATLAB论文的道路!
    • matlab
      matlab经典课堂讲义
    • matlab
      matlab