请问一下大家这个函数的图像怎么编程:
x,y均属于[0,1],且x+y<=1;
t=max(x,y,1-x-y)
n=5+45/(1/x+1/y+1/(1-x-y));
z=0.2806*((3*(1-t)*54.94+t).*n./100+54.94)/1.05;+34.208+0.04+(0.2-x)*0.2+0.1793*8.6*(y+1-x)/2+0.0899.*(44.868+n/100.*(2.*x-1))./(1+n);
画出x-y-z的图像

 Réponse acceptée

dyegqwd
dyegqwd le 23 Mai 2023

0 votes

自己把 x 和 y 分别在定义区间上用 meshgrid函数 网格化;
再构造个三维数组A,每一层分别是 x, y, 1 - x - y;
然后用 max函数 中的 max( A, [], 3 )去计算这个三维数组的最大值得到 t 矩阵;
用 t( x + y > 1 ) = NaN 来只保留符合条件的那部分;
接着自己用点运算求 n 和 z 矩阵;
最后用 surf函数 mesh函数 等绘图

Plus de réponses (0)

Catégories

En savoir plus sur 二维图和三维图 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!