📄 page_two.m
字号:
function varargout = Page_Two(varargin)global Ntaps flnTaps flnCp Vm freq ms Npoints% Much of this content is automatically generated by the 'guide' template.% The callbacks for objects from Page_Two.fig in the 'guide' template are called here.% The variables affected by a particular callback function are listed just below as% global variables.%% PAGE_TWO M-file for Page_Two.fig% PAGE_TWO, by itself, creates a new PAGE_TWO or raises the existing% singleton*.%% H = PAGE_TWO returns the handle to a new PAGE_TWO or the handle to% the existing singleton*.%% PAGE_TWO('Property','Value',...) creates a new PAGE_TWO using the% given property value pairs. Unrecognized properties are passed via% varargin to Page_Two_OpeningFcn. This calling syntax produces a% warning when there is an existing singleton*.%% PAGE_TWO('CALLBACK') and PAGE_TWO('CALLBACK',hObject,...) call the% local function named CALLBACK in PAGE_TWO.M with the given input% arguments.%% *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 Page_Two% Last Modified by GUIDE v2.5 04-Nov-2005 11:52:27% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @Page_Two_OpeningFcn, ... 'gui_OutputFcn', @Page_Two_OutputFcn, ... 'gui_LayoutFcn', [], ... 'gui_Callback', []);if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif 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 Page_Two is made visible.function Page_Two_OpeningFcn(hObject, eventdata, handles, varargin)global Ntaps flnTaps flnCp Vm freq ms Npointshandles.output = hObject;guidata(hObject, handles);set(handles.Object2_30,'string', num2str(Ntaps) )set(handles.Object2_31,'string', flnTaps )set(handles.Object2_32,'string', flnCp )set(handles.Object2_33,'string', num2str(Vm) )set(handles.Object2_34,'string', num2str(freq) )set(handles.Object2_35,'string', num2str(ms) )set(handles.Object2_36,'string', num2str(Npoints) )%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- Outputs from this function are returned to the command line.function varargout = Page_Two_OutputFcn(hObject, eventdata, handles)varargout{1} = handles.output;%%%%%%%%%%%%%%%%% FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function axesA_CreateFcn(hObject, eventdata, handles) % Must Stay!!function Object2_30_Callback(hObject, eventdata, handles)global NtapsNtaps_str = get(handles.Object2_30,'string');Ntaps = str2num(Ntaps_str); % No. of pressure taps on wind tunnel model usedfunction Object2_33_Callback(hObject, eventdata, handles)global Vm Vm_str = get(handles.Object2_33,'string');Vm = str2num(Vm_str); % Wind speed @ model roof (m/s, mean hourly)function Object2_34_Callback(hObject, eventdata, handles)global freqfreq_str = get(handles.Object2_34,'string');freq = str2num(freq_str); % Model scale sampling rate (Hz)function Object2_35_Callback(hObject, eventdata, handles)global msms_str = get(handles.Object2_35,'string');ms = str2num(ms_str); % Model scale (ms:1)function Object2_36_Callback(hObject, eventdata, handles)global NpointsNpoints_str = get(handles.Object2_36,'string');Npoints = str2num(Npoints_str); % No. of sample points per tapfunction Object2_50_Callback(hObject, eventdata, handles)g=figure;set(g,'units','normalized','position',[0.47 0.2 0.5 0.4],'menubar','none','numbertitle',... 'off','resize','off');Two_text=uicontrol(g,'Style','text','Units','Normalized','Position',[0.01 0.01 0.99 0.99],... 'String',[char(10) 'Pressure Tap Information' char(10) char(10) 'Variable name: taps'... char(10) 'Variable size: Ntaps x 5' char(10) char(10) 'Description: Specify the file '... 'location and file name. For each tap (row), the first three columns correspond to its global X, Y, and Z '... 'coordinates, the fourth column to its Tap_Direction, and the fifth column to its tributary '... 'area.' char(10) char(10) 'Coordinate (0,0,0) should be at the building base (Z = 0) and '... 'coincide with the mass center (X,Y = 0). Tap_Direction refers to '... 'the perpendicular wind direction at a given tap: 1 = X-dir, 2 = Y dir. Tributary areas ' ... 'should have proper units. The tap order from row to row should '... 'match the pressure coefficient matrix specified on this page (flnCp).' char(10) ... char(10) 'The first four columns of variable taps correspond, respectively, to variables X_loc, Y_loc, Z_loc '... 'and tap_dir used in the function ''F_Load_Vector''.'],'FontName','Garamond','FontSize',12);function Object2_51_Callback(hObject, eventdata, handles)g=figure;set(g,'units','normalized','position',[0.28 0.55 0.7 0.4],'menubar','none','numbertitle',... 'off','resize','off');Two_text=uicontrol(g,'Style','text','Units','Normalized','Position',[0.01 0.01 0.99 0.99],... 'String',[char(10) 'Pressure Coeff. Info.' char(10) char(10) 'Variable name: Cp_tr' ... char(10) 'Variable size: Ntaps x Npoints' char(10) 'Description: Select one pressure '... 'coefficient file using the ''Open'' button. The file name must end with the wind '... 'direction specified in the last three string characters.' char(10) char(10) 'For '... 'example, the variable Cp_tr for wind direction of 0 degrees must be saved with a '... 'file name ending in 000 (say Cp_000). Likewise, the variable Cp_tr for wind direction of 270 '... 'degrees must be saved with a file name ending in 270 (say Cp_270), and so on. There should '... 'be files within the directory for each wind direction (WD) specified in Page 3.'... char(10) char(10) 'These time histories should have accounted for a possible '... 'reduction in numbers of taps as well as conversion procedures from the actual wind '... 'tunnel data to pressure coefficients at the roof height of the model. Please see the '... 'help (?) icon for ''Loads for Analysis'' on Page One regarding how the program '... 'handles the signs of these pressure.'],'FontName','Garamond','FontSize',12);function Object2_52_Callback(hObject, eventdata, handles)global Ntaps flnTaps flCp Vm freq ms Npoints[fnTaps flTaps] = uigetfile({'*.mat','Matlab file (*.mat)'},['Select file containing '... '''taps'' (Ntaps x 5).'], flnTaps);if fnTaps==0 load ([ flnTaps ]);else flnTaps = fullfile( flTaps , fnTaps ); load ([ flnTaps ]);endset(handles.Object2_31,'string', [ flnTaps ]);function Object2_53_Callback(hObject, eventdata, handles)global Ntaps flnTaps flnCp Vm freq ms Npoints[fnCpx flCpx] = uigetfile({'*.mat','Matlab file (*.mat)'},['Select one file containing '... '''Cp_tr'' (Ntaps x Npoints).'], flnCp );if isequal(fnCpx,0) | isequal(flCpx,0) set(handles.Object2_32,'string', [flnCp]);else fnCp = fnCpx(1:end-7); flnCp = ([flCpx fnCp 'xxx']); set(handles.Object2_32,'string', [flnCp] );endfunction Object2_54_Callback(hObject, eventdata, handles)g=figure;set(g,'units','normalized','position',[0.58 0.13 0.39 0.25],'menubar','none','numbertitle',... 'off','resize','off');Two_text=uicontrol(g,'Style','text','Units','Normalized','Position',[0.01 0.01 0.99 0.99],... 'String',[char(10) 'Wind speed @ model roof' char(10) char(10) 'Variable name: Vm' ... char(10) 'Variable size: 1x1 (constant)' char(10) 'Vm denotes the mean wind '... 'speed at the top of the model. Vm is supplied by the wind tunnel operator, along with the pressure '... 'coefficients, the model scale (ms) and the sampling rate (freq - number of pressure '... 'measurements per second)'],'FontName','Garamond','FontSize',12);% --- Executes on button press in Exit_Button.function Exit_Button_Callback(hObject, eventdata, handles)close all
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -