⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compute.m

📁 matlab中常用电法各种装置的电磁正演计算
💻 M
📖 第 1 页 / 共 5 页
字号:
    set(handles.Rsp_NDEC_txt,    'Enable', 'off');
end


% *************************************************************************
% *                                                                       *
% *   Callbacks for Pushbutton UICONTROLS                                 *
% *                                                                       *
% *************************************************************************

% --------------------------------------------------------------------
function load_batch(hObject, eventdata, handles)

modelwin_han = guidata(handles.modelwin);
if isfield(modelwin_han,'batch') && ~isempty(modelwin_han.batch)
    button = questdlg('Current list will be overwritten!',...
        'Clear list?','OK','Cancel','Cancel');
    if strcmp(button,'Cancel')
        return;
    end
end

[filename, pathname] = uigetfile(                                       ...
    {'*.mat','MAT-files (*.mat)';                                       ...
        '*.*',  'All Files (*.*)'},                                     ...
    'Save batch list as...', '*.mat');
if isequal(filename,0), return; end
file = fullfile(pathname, filename);
if exist(file,'file')
    batchlist = load(file,'batchlist');
    if ~isfield(batchlist,'batchlist'), return; end
    batchlist = batchlist.batchlist;
    names = {'cparams';'config';'layers'};
    if ~all(ismember(names, fieldnames(batchlist)))
        disp('Bad file!');
        disp('Aborting...');
        return;
    else
        modelwin_han.batch = batchlist;
    end
end

menu1 = [handles.calc_batch_menu; handles.save_batch_menu; handles.clear_batch_menu];
if ~isempty(modelwin_han.batch)
    set(menu1, 'visible', 'on');
else
    set(menu1, 'visible', 'off');
end
guidata(handles.modelwin, modelwin_han);

% --------------------------------------------------------------------
function save_batch(hObject, eventdata, handles)

[filename, pathname] = uiputfile(                                       ...
            {'*.mat','MAT-files (*.mat)';                                       ...
                '*.*',  'All Files (*.*)'},                                     ...
            'Save batch list as...', 'batch_list.mat');

if isequal(filename,0), return; end
[tmp1,filename,ext] = fileparts(filename);
if isempty(ext), ext = '.mat'; end
modelwin_han = guidata(handles.modelwin);
batchlist = modelwin_han.batch; 
save(fullfile(pathname, [filename ext] ),'batchlist','-mat');     

% --------------------------------------------------------------------
function clear_batch(hObject, eventdata, handles)

button = questdlg('Clear batch list?',...
    'Clear list?','Yes','No','No');
if strcmp(button,'Yes')
    modelwin_han = guidata(handles.modelwin);
    modelwin_han.batch = [];
    guidata(handles.modelwin, modelwin_han);
    
    menu1 = [handles.calc_batch_menu; handles.save_batch_menu; handles.clear_batch_menu];
    set(menu1, 'visible', 'off');
    
elseif strcmp(button,'No')
    return;
end    


% --------------------------------------------------------------------function Batch_button_Callback(hObject, eventdata, handles)
storeAllSettings(hObject, [], handles);
modelwin_han = guidata(handles.modelwin);
model.cparams = modelwin_han.cparams;
model.config = rmfield(modelwin_han.config,{'plot_handle'});
model.layers = rmfield(modelwin_han.layers,{'label_handle'});

if ~isfield(modelwin_han, 'batch')
    modelwin_han.batch = [];
end
[model, batmodels] = batch(model, modelwin_han.batch);

if ~isempty(model) && ~isempty(batmodels)
    modelwin_han.batch = batmodels;
    if isfield(model, 'name')
        modelwin_han.name = model.name;
    end
    
    menu1 = [handles.calc_batch_menu; handles.save_batch_menu; handles.clear_batch_menu];
    if ~isempty(modelwin_han.batch)
        set(menu1, 'visible', 'on');
    else
        set(menu1, 'visible', 'off');
    end
    
    guidata(handles.modelwin, modelwin_han);
    guidata(hObject, handles);
end
 
% --------------------------------------------------------------------function pushbutton13_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Time_contextmenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Waveform_cmenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Load_cmenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Gates_cmenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function Save_cmenu_Callback(hObject, eventdata, handles)

% -------------------------------------------------------------------------
function Freq_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function NHT_tol_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function FHT_err_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function FDsp_Bmin_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function FDsp_Bmax_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function FDsp_NDEC_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function Times_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function NST_tol_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% -------------------------------------------------------------------------
function Quad_tol_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function Rsp_NDEC_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function Waveform_popup_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% -------------------------------------------------------------------------
function FST_err_edit_CreateFcn(hObject, eventdata, handles)

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes during object creation, after setting all properties.function Seg_tol_edit_CreateFcn(hObject, eventdata, handles)
if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes during object creation, after setting all properties.function Max_seg_edit_CreateFcn(hObject, eventdata, handles)
if ispc    set(hObject,'BackgroundColor','white');else    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end
% *************************************************************************
% *                                                                       *
% *   Functions for storing and plotting the results                      *
% *                                                                       *
% *************************************************************************

% function plot_tem(v, config, cparams, fig)
% 
% if getappdata(0, 'debug')
%     disp('comput2.m:Plot_TEM: Debug before plot...');
% end
% 
% figure(fig, 'visible', 'on');
% 
% if strcmp(cparams.domain,'TD')
%     neg_loglog(cparams.times,v,[],'Markersize',5);
%     ylabel('V/A');
%     % rhoa = (config.TxR.^(4/3).*config.RxA.^(2/3).*(4e-7*pi).^(5/3))./ ...
%     %     (20.^(2/3).*pi.^(1/3).*cparams.times.^(5/3).*v.^(2/3));
%     % loglog(cparams.times,rhoa,'-xb','Markersize',5);
%     % ylabel('\rho_a (\Omega m)');
%     xlabel('Time (sec)');
% else
%     subplot(2,1,1);
%     semilogx(cparams.freq, real(v), '-xb', 'Markersize',5);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -