作者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