作者s65203456 (我离开我自己)
看板Statistics
标题[程式] Matlab程式Error疑问
时间Wed Nov 13 13:41:27 2013
[软体程式类别]:
Matlab
[程式问题]:
旧版写的程式在新版Matlab不能使用
[软体熟悉度]:
新手(不到1个月)
[问题叙述]:
最近因为在使用A Panel Smooth Transition Regression,
程式为朋友给予的在Matlab 2007B版本时皆可顺利跑出结果,
可是同样的程式用到Matlab R2012b时却无法运行,
出现了以下讯息:
****** ESTIMATION of PSTR MODEL ******
Cannot find an exact (case-sensitive) match for 'Star_Panel'
The closest match is: STAR_Panel
in C:\Users\Wu\Desktop\Matlab\PSTR (smooth program)\STAR_Panel.m
Error in main (line 27)
res=Star_Panel(data_H,N,m,rmax);
[程式范例]:
这边我放上原始程式,再麻烦高手帮我看看问题出在哪里,谢谢。
clear all,clc,close all;format short;warning off;
disp(' '), disp('****** ESTIMATION of PSTR MODEL ******'), disp(' ')
%***** input data *****
data=xlsread('1.xls');
y=data(:,1); % dependent variable
q=data(:,5); % threshold variable
x1=data(:,2);
x2=data(:,3);
x3=data(:,4);
T=27;
N=25;
%***** Points Manquants *****
y=reshape(y,T,N);
x1=reshape(x1,T,N);
x2=reshape(x2,T,N);
x3=reshape(x3,T,N);
q=reshape(q,T,N);
y=y(:);
x1=x1(:);
x2=x2(:);
x3=x3(:);
q=q(:);
%***** program setting *****
data_H=[y q x1 x2 x3];
rmax=3; % number of regimes
m=3; % must choose m=3 for model selection, then program
res=Star_Panel(data_H,N,m,rmax);
-----------------------------------------------------------------------------
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.117.77.73
1F:推 loveann:matlab会区分大小写. 试试过把Star_Panel改成star_panel 11/13 23:01
2F:→ loveann:更正,是更改成STAR_Panel 11/13 23:01
3F:→ loveann:res=STAR_Panel(data_H,N,m,rmax); 11/13 23:04
4F:→ s65203456:您好,刚刚更正後,同样无法执行QQ 11/13 23:06
5F:→ LiamIssac:改过之後的error msg是? 11/14 08:08
7F:→ s65203456:上列网址为改过後的error msg 11/14 18:54
8F:推 loveann:问题依旧是档名大小写。你要把OPTIMSET改成小写 11/16 20:42
9F:→ loveann:你要学会看error msg,因为两次的error msg都一样。 11/16 20:43
10F:→ s65203456:谢谢您,可是我在程式码里面找不到optimset这个字 11/17 14:45
11F:→ s65203456:error msg显示在line 39 可是程式只到line 27 11/17 14:46
12F:→ loveann:error msg是要你去看STAR_Panel.m的第39行。 11/17 18:15
13F:→ loveann:你会看到STAR_Panel.m的第39行出现OPTIMSET 11/17 18:16
14F:→ s65203456:感谢loveann,问题已解决! 太感谢了! 11/18 10:47