% 定义主应力范围 s1 = linspace(-50, 50, 100); s2 = linspace(-50, 50, 100); s3 = linspace(-50, 50, 100); % 创建网格 [S1, S2, S3] = meshgrid(s1, s2, s3); % 计算Mises和Drucker屈服函数 mises = sqrt(0.5 * ((S1 - S2).^2 + (S2 - S3).^2 + (S3 - S1).^2))-20; drucker = sqrt(3/2) * sqrt(((S1 - S2).^2 + (S2 - S3).^2 + (S3 - S1).^2) + 6*(S1.^2+S2.^2+S3.^2))-6.*(S1+S2+S3)/3; % 绘制Mises屈服面 figure; isosurface(S1, S2, S3, mises, 1); % 绘制Mises屈服面 xlabel('s1'); ylabel('s2'); zlabel('s3'); title('Mises屈服面');给这段代码画的三维图增加网格
时间: 2023-10-26 12:04:41 浏览: 130
Matlab期末考试题库(共套卷)-50页.pdf
5星 · 资源好评率100%
在绘制Mises屈服面的代码后面添加以下代码:
```
grid on;
```
修改后的完整代码如下:
```
% 定义主应力范围
s1 = linspace(-50, 50, 100);
s2 = linspace(-50, 50, 100);
s3 = linspace(-50, 50, 100);
% 创建网格
[S1, S2, S3] = meshgrid(s1, s2, s3);
% 计算Mises和Drucker屈服函数
mises = sqrt(0.5 * ((S1 - S2).^2 + (S2 - S3).^2 + (S3 - S1).^2))-20;
drucker = sqrt(3/2) * sqrt(((S1 - S2).^2 + (S2 - S3).^2 + (S3 - S1).^2) + 6*(S1.^2+S2.^2+S3.^2))-6.*(S1+S2+S3)/3;
% 绘制Mises屈服面
figure;
isosurface(S1, S2, S3, mises, 1);
xlabel('s1');
ylabel('s2');
zlabel('s3');
title('Mises屈服面');
grid on;
```
阅读全文