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

📄 compmap.m

📁 求解predator-prey的代码
💻 M
字号:
function compmap(strfun,xmin,xmax,ymin,ymax)
% This function maps a mesh of lines parallel
% to the coordinate axes in the complex plane
% into the image of the rectangular mesh under
% the function defined by strfun, a character
% string specifing the function.

fun=fcnchk(strfun,'vectorized');
dx=(xmax-xmin)/15;
dy=(ymax-ymin)/15;
v=linspace(ymin,ymax,100);
h=linspace(xmin,xmax,100);

%First map the vertical lines
for x=xmin:dx:xmax
  mapvert=fun(x+v*i);
  plot(mapvert); hold on;
end

%Now map the horizontal lines
for y=ymin:dy:ymax
  maphoriz=fun(h+y*i);
  plot(maphoriz)
end

axis equal;
hold off;

⌨️ 快捷键说明

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