fun.m
来自「这是在网上下的一个东东」· M 代码 · 共 53 行
M
53 行
%% Computes forward model predictions for the EM-38 problem.%function f=fun(sigma)%% Number of layers.%M=11;%% Layer thicknesses.%D=0.2*ones(10,1);%% Operating frequency.%f=14600;OMEGA=2*pi*f;%% Distance between coils.%R=1.0;%% Conductivity of the air above the top layer.%SIGMA0=0;%% Magnetic permeabilities.%MU0=pi*4e-7;MU=MU0*ones(11,1);%% Scaling factor Delta.%DELTA=sqrt(2/(sigma(1)*MU0*OMEGA));%% Heights of measurements.%heights=[0.0; 0.1; 0.2; 0.3; 0.4; 0.5; 0.75; 1.0; 1.50];%% Now, do the predictions.%pred=[];pred=zeros(length(heights),2);for i=1:length(heights) H=heights(i); [predv,predh]=predict(R,DELTA,H,M,MU,MU0,sigma,SIGMA0,D,OMEGA); pred(i,:)=[predv predh];end%% Stack up the predictions (vertical over horizontal)%f=[pred(:,1); pred(:,2)];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?