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

📄 shimsim.m

📁 核磁共振谱仪的匀场仿真程序。仿真了比较简单的匀场过程
💻 M
字号:
function argout=ShimSim(p,varargin)

%r=0:0.01:0.5;
%theta=0:0.1:2*pi;
global B;
global x;
global y;
global z;
%x=0:0.02:0.4;
%y=x;
%z=0:0.02:4;
%deltaB=100+linspace(0,50,1000);


%deltaB=reshape(deltaB,10,10,10);
t=0:0.002:0.2;

M=zeros(1,length(t));
%a=length(x);
%b=length(y);
%c=length(z);
%d=zeros(a,b,c);
%n=1;
a=21;b=21;c=201;
%Bmax=200;
%B=Bmax*ones(a,b,c);
%for k=1:a
 %   B(k,:,:)=B(k,:,:)+x(k)*30;
 %end
%p=p*5;
for k=1:a
    for l=1:b
        for m=1:c
           % x=r(k)*cos(theta(l));
            %y=r(k)*sin(theta(l));
            %d(k,l,m)=10*deltaB(x(k),y(l),z(m),p);
            d=B(k,l,m)+deltaB(x(k),y(l),z(m),p,50);
            tmp=exp(i*2*pi*d*t);
            M=M+tmp;
        end
    end
end
M=M.*exp(-t);
%figure(1),subplot(211),plot(real(M)),subplot(212),plot(imag(M));


argout=max(abs(fft(M)));
if length(varargin)==1
    figure,plot(abs(fft(M))/1000);
end

⌨️ 快捷键说明

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