haifeng990 发表于 2010-6-25 21:32:47

大家帮忙看看这个程序出错在哪里?

clear all;close all;clc;
x=;
%倾向200m
y=;
%走向100m
=meshgrid(x,y);
Z=[0
0


0


0


0

0

0
0
0
0
0
0
0
0
0;


0
0.05

0.1

0.14
0.17
0.18
0.19
0.2
0.19
0.18
0.17
0.14
0.1
0.05
0;

0
0.08
0.15
0.22
0.3
0.32
0.34
0.35
0.34
0.32
0.3
0.22
0.15 0.08
0;


0
0.1
0.2
0.3
0.35
0.4

0.45
0.5

0.45
0.4

0.35
0.3
0.2
0.1

0;


0
0.09
0.15
0.22
0.28
0.3

0.35
0.4
0.35
0.3
0.28
0.22
0.15 0.09
0;

0
0.04
0.08
0.12
0.18
0.21

0.25
0.3
0.25
0.21 0.18
0.12
0.08 0.04

0;

0
0.03
0.05
0.08
0.1
0.12

0.16
0.2
0.16
0.12 0.1
0.08
0.05 0.03

0;

0
0.03
0.04
0.06
0.08
0.1

0.11
0.12
0.11
0.1

0.08 0.06
0.04 0.03

0;


0
0.03
0.04
0.06
0.07
0.08

0.09
0.1
0.09
0.08
0.07 0.06
0.04 0.03

0;
xi=linspace(0,200,100);
yi=linspace(0,100,50);
=meshgrid(xi,yi);

ZI=interp2(X,Y,Z,XI,YI, 'cubic');
figure;
%可以不要
surf(XI,YI,ZI);
%如果是这个函数的话就没有等高线了

shading interp
title(['方法:', 'cubic']);
xlabel('倾向');
ylabel('走向');
zlabel('瓦斯压力');
rotate3d on
box on
输入上面的程序后,说是??? xi=linspace(0,200,100);
      |
Error: The expression to the left of the equals sign is not a valid target for an assignment.
请大家帮忙看看怎么回事啊,谢谢。

messenger 发表于 2010-6-26 10:07:23

看看Matlab工作目录下,是否有你自己编的一个叫xi.m的程序。

qibbxxt 发表于 2010-6-26 16:57:47

我试了一下,没有问题,应该是楼上说的,linspace的参数的问题

clear all;close all;clc;
x=;
%倾向200m
y=;
%走向100m
=meshgrid(x,y);
Z=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0.05 0.1 0.14 0.17 0.18 0.19 0.2 0.19 0.18 0.17 0.14 0.1 0.05 0;
0 0.08 0.15 0.22 0.3 0.32 0.34 0.35 0.34 0.32 0.3 0.22 0.15 0.08 0;
0 0.1 0.2 0.3 0.35 0.4 0.45 0.5 0.45 0.4 0.35 0.3 0.2 0.1 0;
0 0.09 0.15 0.22 0.28 0.3 0.35 0.4 0.35 0.3 0.28 0.22 0.15 0.09 0;
0 0.04 0.08 0.12 0.18 0.21 0.25 0.3 0.25 0.21 0.18 0.12 0.08 0.04 0;
0 0.03 0.05 0.08 0.1 0.12 0.16 0.2 0.16 0.12 0.1 0.08 0.05 0.03 0;
0 0.03 0.04 0.06 0.08 0.1 0.11 0.12 0.11 0.1 0.08 0.06 0.04 0.03 0;
0 0.03 0.04 0.06 0.07 0.08 0.09 0.1 0.09 0.08 0.07 0.06 0.04 0.03 0];
xi=linspace(0,200,100);
yi=linspace(0,100,50);
=meshgrid(xi,yi);
ZI=interp2(X,Y,Z,XI,YI, 'cubic');
figure;
%可以不要
surf(XI,YI,ZI);
%如果是这个函数的话就没有等高线了
shading interp
title(['方法:', 'cubic']);
xlabel('倾向');
ylabel('走向');
zlabel('瓦斯压力');
rotate3d on
box on

shangrilaer 发表于 2010-6-26 20:22:48

还真的没有错误啊 不过遇到了m文件文件名格式要求的问题……哈哈 学了一个问题

haifeng990 发表于 2010-6-27 18:34:25

谢谢你,我试了,是没错。
页: [1]
查看完整版本: 大家帮忙看看这个程序出错在哪里?