当前位置:服务支持 >  软件文章 >  一个matlab绘制四维图的实用例子

一个matlab绘制四维图的实用例子

阅读数 7
点赞 0
article_banner
这个问题相当于有限元里面后处理的例子。一个数组一共四列,前三列为坐标xyz,第四列为温度。
clear
clc
data=load('c:/nodetemp.txt')
sx=0:0.2/5:0.2
sy=0:0.3/5:0.3
sz=0:0.2/5:0.2
v=zeros(6,6,6)
for index=1:216
if (data(index,1)-0.00)<1e-5
xbiao=1
elseif (data(index,1)-0.04)<1e-5
xbiao=2
elseif (data(index,1)-0.08)<1e-5
xbiao=3
elseif (data(index,1)-0.12)<1e-5
xbiao=4
elseif (data(index,1)-0.16)<1e-5
xbiao=5
elseif (data(index,1)-0.2)<1e-5
xbiao=6
end

if (data(index,2)-0.00)<1e-5
ybiao=1
elseif (data(index,2)-0.06)<1e-5
ybiao=2
elseif (data(index,2)-0.12)<1e-5
ybiao=3
elseif (data(index,2)-0.18)<1e-5
ybiao=4
elseif (data(index,2)-0.24)<1e-5
ybiao=5
elseif (data(index,2)-0.3)<1e-5
ybiao=6
end

if (data(index,3)-0.00)<1e-5
zbiao=1
elseif (data(index,3)-0.04)<1e-5
zbiao=2
elseif (data(index,3)-0.08)<1e-5
zbiao=3
elseif (data(index,3)-0.12)<1e-5
zbiao=4
elseif (data(index,3)-0.16)<1e-5
zbiao=5
elseif (data(index,3)-0.2)<1e-5
zbiao=6
end

v(xbiao,ybiao,zbiao)=data(index,4)
end
[x,y,z] = meshgrid(0:0.2/5:0.2,0:0.3/5:0.3,0:0.2/5:0.2)

slice(x,y,z,v,data(:,1),data(:,2),data(:,3))

colorbar
读入的txt文件:

结果图形:
untitled.jpg


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删
相关文章
QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空