matlab程序出错求解,在线等
%Josab1855%Grayspatialsolitonsinbiasedphotorefractivemeida%Fig_1_bPhasefunctionFig_1_...
% Josab 18 55
% Gray spatial solitons in biased photorefractive meida
% Fig_1_b Phase
function Fig_1_b
tic;
clear;clc;
global Rho m smax
Rhoi = [40];
colors = ['k','b','e','g','y']; % ?? Rho ????
mi = [0.1 0.2 0.4 0.6 0.8]; % ????
Smax = 10;
NSmax = 2^8;
smaxi = linspace(eps,Smax,NSmax);
kr = 1;
while kr <= length(Rhoi)
Rho = Rhoi(kr)
km = 1;
while km <= length(mi)
m = mi(km);
ks = 1;
while ks <= NSmax
smax = smaxi(ks);
[Sr Yr v] = Cal_Y(Rho,m,smax);
Ns = 2^8;
SI = linspace(0,smax,Ns);
dsi = SI(2)-SI(1);
YI = interp1(Sr,Yr(:,1),SI,'spline');
Y2_inv = 1./YI.^2;
Phase(ks) = v*(smax-(2*sum(Y2_inv)-Y2_inv(1)-Y2_inv(end))*dsi/2);% ?????à??
ks = ks+1;
end
plot(-smaxi,-Phase,colors(kr),smaxi,Phase,colors(kr));hold on;
text(7.5,Phase(end-10),['m = ',num2str(m)]);
km = km+1;
end
kr = kr+1;
end
xlabel('s','Fontsize',20);
ylabel('Phase','Fontsize',20);
axis([-10 10 -2 2]);
set(gca,'YTick',[-pi/2,0,pi/2]);
set(gca,'YTickLabel',{'-pi/2','0','pi/2'});
toc;
%================================END=======================================
就是这个程序,运行出错,求高手改错并标注各个语句什么意思,有加分,在线等 展开
% Gray spatial solitons in biased photorefractive meida
% Fig_1_b Phase
function Fig_1_b
tic;
clear;clc;
global Rho m smax
Rhoi = [40];
colors = ['k','b','e','g','y']; % ?? Rho ????
mi = [0.1 0.2 0.4 0.6 0.8]; % ????
Smax = 10;
NSmax = 2^8;
smaxi = linspace(eps,Smax,NSmax);
kr = 1;
while kr <= length(Rhoi)
Rho = Rhoi(kr)
km = 1;
while km <= length(mi)
m = mi(km);
ks = 1;
while ks <= NSmax
smax = smaxi(ks);
[Sr Yr v] = Cal_Y(Rho,m,smax);
Ns = 2^8;
SI = linspace(0,smax,Ns);
dsi = SI(2)-SI(1);
YI = interp1(Sr,Yr(:,1),SI,'spline');
Y2_inv = 1./YI.^2;
Phase(ks) = v*(smax-(2*sum(Y2_inv)-Y2_inv(1)-Y2_inv(end))*dsi/2);% ?????à??
ks = ks+1;
end
plot(-smaxi,-Phase,colors(kr),smaxi,Phase,colors(kr));hold on;
text(7.5,Phase(end-10),['m = ',num2str(m)]);
km = km+1;
end
kr = kr+1;
end
xlabel('s','Fontsize',20);
ylabel('Phase','Fontsize',20);
axis([-10 10 -2 2]);
set(gca,'YTick',[-pi/2,0,pi/2]);
set(gca,'YTickLabel',{'-pi/2','0','pi/2'});
toc;
%================================END=======================================
就是这个程序,运行出错,求高手改错并标注各个语句什么意思,有加分,在线等 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询