knrt.net
当前位置:首页 >> mAtlAB怎么画x+y+z=0.5的三维平面图,只需要在第一... >>

mAtlAB怎么画x+y+z=0.5的三维平面图,只需要在第一...

[x,y] = meshgrid(0:0.01:0.5); z = 0.5-x-y; L = z

x=-10:0.1:10;y=-10:0.1:10; %设定你需要的x和y的范围,这里x和y假设都从-10取到10 [xx,yy]=meshgrid(x,y); %利用meshgrid函数将x和y从向量展成矩阵xx和yy z=(xx.*yy./(xx.^2+yy.^2).^0.5); %利用xx和yy求z mesh(xx,yy,z); %作图。mesh函数求得...

clear; clc; [fx,fy,fz]=meshgrid(linspace(-1,1)); fv=fx.^2+fy.^2+fz.^2-1; contourslice(fx,fy,fz,fv,0.5,[],[],[0 0]); view(3)

你这个是要画曲面图,画曲面图通常用surf和mesh函数,而这两个 %函数都需要知道对应x,y向量交叉点内所有点处的z值,所以得用如 %x=-200:0.3:200;y=-200:0.1:200; %[X,Y]=meshgrid(x,y); %Z=(X-Y)^0.5+(X+Y)^0.5 %获得z值,再用mesh(X, Y, Z);绘...

A=[1.486,3.059,0.1;2.121,4.041,0.1;2.570,3.959,0.1;3.439,4.396,0.1; 4.505,3.012,0.1;3.402,1.604,0.1;2.570,2.065,0.1;2.150,1.970,0.1; 1.794,3.059,0.2;2.121,3.615,0.2;2.570,3.473,0.2;3.421,4.160,0.2; 4.271,3.036,0.2;3.411,1.876,0...

syms x yz=0.5*x^2+0.01*y^2+1500;ezmesh(z);

举个例子: x=60:90:960; y=0:5:50; [ X Y ] = meshgrid( x, y );% 首先要根据xy编织网格 Z = X .* Y;% 计算Z,注意涉及到乘除等运算,运算符前要加个点 mesh( X, Y, Z );

这就是一个普通数值方程,在0,1范围内,类似于高斯曲线。如果想看结果,可以用下述命令实现: >> y=0:0.01:2; >> x=0:0.01:2; >> plot3(x,y,x.*exp(-0.5*x.^2-y.^3))

倒数第二、三行加上两个点就可以了,参考下面的修改: x=0:0.01:0.5; y=0:0.01:0.5; [x,y]=meshgrid(x,y); z1=x.^2+0.02*x.*y+0.1*y.^2; z2=1+sqrt(1-x.^2-0.02*x.*y-0.01*y.^2); z=z1./z2; mesh(x,y,z)

这是一种画法; x=-5:5; y=x*0+0.5/1; plot(x,y) 结果为: 这是第二种画法,结果相同: clear all;close all; syms x; y=x*0+0.5/1; ezplot(y)

网站首页 | 网站地图
All rights reserved Powered by www.knrt.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com