【发布时间】:2016-11-08 18:41:49
【问题描述】:
我已经绘制将图表分成 1。我想通过反复试验最大化 z=abs(1+s+(alpha_2)*s.^2+(alpha_1)*(alpha_2)*s.^3),因此其他图表可以尽可能大地放入其中。所以我想做两个 for 循环来改变 alpha_1 和 alpha_2 的值。例如
for alpha_1=1:0.5:2
for alpha_2=1:0.5:2
z=abs(1+s+(alpha_2)*s.^2+(alpha_1)*(alpha_2)*s.^3);
[C,h] = contour(x,y,z,[1 1]);
end do
end do
所以该图将绘制 9 个不同的图。是否可以将这 9 个图放入图中并说出每个图的 alpha_1 和 alpha_2 的值是多少?
原始程序:
clear all
close all
alpha_1=0;
alpha_2=0;
theta = 2*pi
clear t w;
t = 0: theta/100: theta;
w=-1/6*(3-4*cos(t)+cos(2*t)+1i*(8*sin(t)-sin(2*t)));
figure(1)
plot(w,'r')
hold on
%axis( [-10,10, -10,10] )
axis square; grid on
%Contour plot
[x,y] = meshgrid(-2.5 : 0.02:2.5, -2.5 : 0.02: 2.5);
s = x + 1i*y;
z=abs(1+s+(alpha_2)*s.^2+(alpha_1)*(alpha_2)*s.^3);
[C,h] = contour(x,y,z,[1 1]);
clabel(C,h)
【问题讨论】:
标签: matlab matlab-figure