当前位置:网站首页 > MATLAB编程 > 正文

matlab函数linspace参数过多(matlab 函数参数)



matlab画三维函数参数⽅程,如何在matlab中绘制含有三个参

数⽅程的三维图形

【1】ezimplot3 存储该M⽂件,并将⽂件路径设置为matlab当前路径

function h = ezimplot3(fun,domain,n,color)

% EZIMPLOT3 Easy to use 3D implicit plotter.

% EZIMPLOT3(FUN) plots the inline function FUN(X,Y,Z) = 0 over the

% default domain -2*PI X 2*PI, -2*PI Y 2*PI, -2*PI Z 2*PI.

%

% EZIMPLOT3(FUN,DOMAIN)plots FUN over the specified DOMAIN instead of the

% default domain. DOMAIN can be the vector [XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX]

% or the vector [A,B] (to plot over A X B, A Y B, A Z B).

%

% EZIMPLOT3(...,N) plots FUN over the default domain using an N-by-N grid.

% The default value for N is 60.

%

% Example

% Plot x^3+exp(y)-cosh(z)=4

%

% via a string: f=x^3+exp(y)-cosh(z)-4

% ezimplot3(f)

%

% via a vectorized function handle: f = @(x,y,z) x.^3+exp(y)-cosh(z)-4

% ezimplot3(f)

%

% Note: this function do not use the ezgraph3 standard, like ezsurf, ezmesh

% ,etc, does. Because of that, ezimplot3 only tries to imitate that

% interface. A future work must be to modify the ezgraph3 to include a

% routine for implicit surfaces based on this file

%

% Inspired by works of: A.Jutan UWO 02-02-98

% Made by: G.Morales UC 03-20-09

%

if nargin == 1

domain = [-2*pi, 2*pi]; % default domain: -2*pi xi 2*pi

n = 60; % default grid size

elseif nargin == 2

n = 60; % just default grid

end

if size(domain,2) == 2

domain = repmat(domain,1,3); %domain repeated in all variables

end

xm = linspace(domain(1), domain(2), n); % generating the volume data

ym = linspace(domain(3), domain(4), n);

zm = linspace(domain(5), domain(6), n);

[x,y,z] = meshgrid(xm, ym, zm);

if ischar(fun)

fun = inline(vectorize(fun)); % making sure string fun is vectorized

fvalues = feval(fun,x,y,z); % evaluating fun in domain

elseif isa(f

到此这篇matlab函数linspace参数过多(matlab 函数参数)的文章就 介绍到这了,更多相关 内容请继续浏览下面的相关 推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • matlab如何输出多个变量的值(matlab如何输出多种结果)2025-02-19 19:27:07
  • matlab的函数怎么用(matlab中的函数)2025-02-19 19:27:07
  • matlab中的脚本文件和函数文件的后缀名不一样(matlab脚本文件和m文件的区别)2025-02-19 19:27:07
  • matlab中输入参数太多(matlab输入参数太多出错)2025-02-19 19:27:07
  • matlab函数用法大全(matlab函数大全详解)2025-02-19 19:27:07
  • matlab天蓝色颜色代码(matlab中蓝色的线)2025-02-19 19:27:07
  • matlab函数(matlab函数输出多个变量)2025-02-19 19:27:07
  • matlab函数大全及例子(matlab函数功能大全)2025-02-19 19:27:07
  • matlab 常用函数(matlab常用函数与常用指令大全)2025-02-19 19:27:07
  • matlab脚本和函数合起来运行(matlab脚本文件和函数文件怎么联系)2025-02-19 19:27:07
  • 全屏图片