24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1041  |  回复: 0

wwa_1986

金虫 (小有名气)

[求助] matlab中[c,h]contour()中的c矩阵存为porous.txt文件,vba读取txt数据画等高线图

txt文件为2*7642的矩阵,具体已贴出来。运行时有误。
Dim sumpoints As Double
Open "d:\porous.txt" For Input As #1
Input #1, sumpoints '从文件读出总的点数
ReDim points(0 To sumpoints * 3 - 1) As Double
Dim plineObj As AcadPolyline
npoints = 0
For i = 1 To sumpoints '遍历轮廓线中所有点
     Input #1, x, y '从文件读出i点的x,y坐标
     points(npoints) = x    '第i点的x坐标
     points(npoints + 1) = y '第i点的y坐标
     points(npoints + 2) = 0 '第i点的z坐标
     npoints = npoints + 3
Next
'生成轮廓线
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)   'points为存放顶点坐标的一维数组,大小为顶点数的三倍
Zoom All
Close
回复此楼

» 本帖附件资源列表

  • 欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
    本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:xiaomuchong@tal.com
  • 附件 1 : porous.txt
  • 2013-03-27 11:03:41, 238.82 K

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 wwa_1986 的主题更新
信息提示
请填处理意见