声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2097|回复: 2

[编程技巧] Vectors must be the same lengths

[复制链接]
发表于 2007-7-18 11:11 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
??? Error using ==> plot
Vectors must be the same lengths.

Error in ==> demogrn1 at 14
plot(P,T,'.')
请问怎样改


以下是程序
P =0:1:200;
T =[0 20 38 54 72 80 90 87 80 70];

plot(P,T,'.')
axis([25 50 100 150 200])
title('Function to approximate.')
xlabel('P')
ylabel('T')



spread = 0.7;
net = newgrnn(P,T,spread);
A = sim(net,P);

hold on
outputline = plot(P,A,'.','markersize',30,'color',[1 0 0]);
title('Create and test a network.')
xlabel('P')
ylabel('T and A')



p = 3.5;
a = sim(net,p);
plot(p,a,'.','markersize',30,'color',[1 0 0]);
title('New input value.')
xlabel('P and p')
ylabel('T and a')



P2 = 0:.1:9;
A2 = sim(net,P2);
plot(P2,A2,'linewidth',4,'color',[1 0 0])
title('Function to approximate.')
xlabel('P and P2')
ylabel('T and A2')
回复
分享到:

使用道具 举报

发表于 2007-7-18 11:13 | 显示全部楼层
发表于 2007-7-18 16:04 | 显示全部楼层
看一下置顶贴,p,T的维数不相等
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-6-16 00:05 , Processed in 0.066068 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表