CONCLUSION Forecasting Stock Price Index Using Artificial Neural Networks in the Indonesian Stock Exchange.

49

CHAPTER 6
CONCLUSION

ims to find the answer of the foll
im
llow
o ing question: how to
This paper aaims
following
forecaast the stock price ind
ndex
x iin
n in Indonesian
Ind
ndon
oneesian stock exchange?
exch
han
ange? Whether the

forecast
index
fo
IDX
X through
thr
hrouugh the learning procedure
proced
dur
uree techniques
tech
te
c niques of ANN
AN model or
forecasted
not. Is itt RWH
comparing
results
H and
and EMH theory true?. And

And comp
parin
ingg th
tthee resu
ult
l s with
some recent
recen
ent research using ANN model in this market
t.
some
market.
oveme
m nt
ntss of
o thee
Duee to the issue of accurately forecasting the direction of mo
movements
sttock market price levels is highly significant for formulat
ating th

thee best
s
stock
formulating
market trading solutions. It is fundamentally affecting financ
cial trade
er’ss
market
financial
trader’s
decisions to buy or sell.
decisions
b cconcluded
onclud
on
uded
ed as follows:
The research finding can be
ANN
NN techni

niqu
quee ca
ccan
n be applicable to fforest
ores
or
e t stoc
ck pr
pric
ice in
inde
dexx in
a. AN
technique
stock
price
index
Indonesiian stock
stock market,
mar

a ket, The
The rresults
esultss of
of learning
lear
arni
ning
ng rate can be reached
reeached
Indonesian
99%,
99%
99
%, while
while the best resultt of forecasting
foreecasting rate is 66%,
% and
and the
the worst rate is
51%. This forecasting

g technique is considered as a new method which
need to be improved in te
term
designing
erm of de
esigning the model and find out its input
variable that the market related
rel
e ateed to. So that it will enhance the better
forecasting
f
i results.
l
b. The power of prediction may not really high in this research
methodology as the author’s expectation. However, the prediction result

50

showed above is fairly good. So, it means that stock market price can be
predictable.

comparing
performance
c. In terms of comparin
ingg ANN
ANN perf
forrma
mance with recently research. Putra
and Kosalaa ((2011)-using
2011)-using technical variables as input data, the highest
accuracy
80.48%
and
worst
accu
curracy rate is 80.48
4 % an
nd th
the wo
w
rst one is 449.90%,

9 90%, but their
9.
wass fo
focused on individuall company,
comp
co
mpan
any, not indexx prices.
prices. For
forecasting wa
Veri aand
nd Bab
ba (2
(2013) forecasting index pprice
rice off th
ri
thee nnext
ext tradi
ding day
Veri

Baba
trading
they’ve
results
theey’vee used daily prices as input variables, the empirical
th
em
mpi
p rical re
resu
sult
ltss showed
show
owed
percentage
varied
that
at 95% of training accurate and for prediction value pe
percen
nta

tage
g varie
ed
provided
ffrom
rom 95% to 5% of accuracy. Due to both research pro
rovide
dedd hi
higher
forecasting rate so this research model is not outperform their
th
heir research
researrch
methodology.
dd.. However, aauthor
utho
ut
horr be
beli
liev

e es this meth
hod
odol
olog
ogyy can
c n be applied
ca
d aalong
long w
itth
believes
methodology
with
tra
radiing decision.
other techniques to help a trading
e This research methodology has been proved very successf
sful
ul iin
n oother
thher
e.
successful
sttock
k market
mark
rket
et rresearch
esearch llike
es
ikee LM
ik
LMY,
Y, T
EPX, eetc.
tc.. th
tc
ther
e e are some factors
fac
acto
tors
rs may
stock
TEPX,
there
he results of this rresearch
esearch as
as to be mentioned
mentiion
oned
ed in thee li
lim
mitation of
affect tthe
limitation
this study.
rs in the rresearch
esearch may not enhance the accuracy
f. A few of input indicator
indicators
rate (unnecessary), because
e, thi
is stock market can be affected by many
because,
this
macro-economic factors suchh as political events,
events investors’ expectations,
expectations
institutional investors’ choices, firms’ policies, general economic

51

conditions, interest rates, foreign exchange rates, movement of other
stock market, psychology of investors etc.
The limitations of current
current study:

Forecas
asti
t ng stock price index using
Forecasting

artificial neural
neu
eural network is a new methodology applied
appli
lied
e in emerging market
(Suchira
Chaigusin,
comparing
(Suc
chi
hira Chaig
gusin
n, 2011)) co
omp
mpar
arin
ng tto
o oother
th
her methodologyy ii.e.
.e. fundamental
analysis,, technical
t chnica
te
call analysis eetc.
tc. accessibility
tc
acce
ac
cess
ssibility to this
thi
h s methodology
meeth
t odology have
h ve some
ha
limited.
limi
mite
ted.
d
Thee m
most
Th
T
ost important part of research work is to concentration
concentrat
a ion on ccoding
o ing or
od
o
prog
ograming to create the right forecasting model and find
nd outt the
he bestt
programing
training
best
forecasting
trraining parameter combination in the goal off reaching the bes
st for
rec
ecas
asting
ng
results.
results. Meanwhile the researcher himself has very less experience
experiience inn the
field
technologies,
field of computer science and information technologie
es, as tthis
hiss
hi
knowledge/skill is required
model
d by thee research
res
esearch itself. So, the forecasting mo
mode
del
in this research may not perfectly done as same as IT expert does. However,
How
wev
eveer,
author
research
will
other
students
auth
au
thor
or hhope
opee th
op
that
at tthis
hiss re
hi
rese
sear
arch
ch wil
ll be tthe
he ffirst
irst
ir
st sstep
tepp fo
te
forr ot
othe
herr st
stud
uden
ents
ts who
wish
wish to
to continue
contin
co
nue improving
ng this research
researrch methodology
methoddol
olog
ogy or other
oth
ther
er ANN
ANN model.
or would like
likke to provide some such suggestion as
For further research, autho
author
following:
through using matlab tool box, which will
a. Improving this methodologyy through
enhance more accurate prediction rate.
b. Each method has its own strengths and weaknesses. So, author suggest
to use technical indicators of this study and other combining techniques

52

models by integrating ANN with other classification models such as
Support Vector Machines (SVM), Genetics Algorithm (GA) etc. The
weakness of one me
method
eth
thod
od can be ba
bbalanced
lanc
la
n ed by the strengths of another by
achievingg a ssystematic
ystematic effect.
of this
c. To the
the best knowledgee off tthe
h aauthor,
he
utho
ut
hor,, the
the prediction performance
pe
model can bbee im
ways
improved by many way
ayss

i.e. adjustingg the model

parameters
paara
rame
mete
ters byy conducting
co
a more sensitivee and
an comprehensive
comp
mpre
rehe
hensive parameter
paara
r meter
setting.
settting.
se
g.

Otherwise, reduction of current variab
variables
adding
more
ble
les andd ad
addi
ding m
ore

different
diff
fferent input variables i.e. macro-economic variabless suchh as
as foreign
foreig
gn
exchange rates, interest rates and international stock indexes
related
index
xes
e that
tha
hatt re
rela
l tedd
to IDX, etc.

Benefit off thi
this
believes
method
would
hiss research:
rese
re
sear
arch
ch: author belie
ieve
vess th
that
at tthis
h s research m
hi
ethhod wo
et
oul
uldd
benefits to other students in
about
in many
m ny ways for their further study ab
ma
abou
out
using artificial neural network as a tool to forecast stock prices
prices:
es::
a. For
student
don’t
ANN,
this
provide
For stud
tuden
entt who do
don’
n’tt know
know about
about A
NN,, th
NN
thi
is research can
caan pr
pro
ovide
some
ANN,
work
me iinformation
nformation and
nd idea onn A
NN, how its w
ork and wh
or
why it’s used
in financial field.
b. It will be the basicc idea fo
for
or students who wants to try a new
methodology of forecasting
foreccastinng stockk prices, especially, who are
majoring finance or related
fields.
ed fields
c. Student can learn some part of its function used in this research and
its code in the matlab program. So that they can create their own

53

methodology and may have more powerful prediction model than
current research.
d. Author believes th
research
that this rese
ear
arch
c methodology cannot be done
without
withouut any mistake. However, this research
researc
rchh provides student some
basic
understanding
ba
understandin
ng on hhow
ow tto
o do
d it and also bbenefits
enefits to other
research
he r m
ore or less in someway.
or
researcher
more
wan
antt to bee a su
succ
ccessful in
iinvestor
vestor
e.. A
Ass w
wee are a student at present who want
successful
in the
ways
the future, we cannot reliance on the old way
ys of fforecasting
orec
or
ecas
asti
t ng sstock
t ck
to
prices or using single analyzing technique for mak
making
investment
a ingg in
inve
v stmennt
decision. This technique (ANN) is highly supported forr further
furrth
ther
er sstudy
tudy
eing th
he firs
rst
and author believes this research can be a reference or be
being
the
first
techn
hnique
ue
step for other researcher who never used this forecastingg technique
before.

54

REFERENCES
Alireza Shahkarami, Shahab D. Mohaghegh & Vida Gholami (2014)
g
((AI)) Assisted Historyy Matching.
g West
Artificial Intelligence
ers
rsit
ity, SPE-169507-MS
SPE-169950
5077-MS
Virginia Unive
University,
Ayoddel
ele A., Ayo Charles K., Adeb
biy
iyii Marion O. and Otokiti
Adebiyi Ayodele
Adebiyi
Suunday O. (2009)
(20009) Stock Price Prediction using
u ing Neural Network
us
Sunday
d Ma
Mark
ket Indicator
o s. Journal off E
merging Trends in
with Hybridized
Market
Indicators.
Emerging
Compputin
ing
g and Information
Info
In
form
rmat
atio
ionn Sciences.
Scie
Sc
ienc
nces. Retrievedd January 2012.
Computing
3, No.
No 1
Vol. 3,
y, E.,
E., & Hakan S
atman, M. (2005)
at
5) S
tock
to
c markett fo
for
recasting: artificial
Altay,
Satman,
Stock
forecasting:
etwork and linear regression comparison
com
o pariso
sonn in an em
merging
neurall nnetwork
emerging
maark
rket. Journal of Financial Management an
and An
Anal
alys
ysis
is, 18(2
2), 18market.
Analysis,
18(2),
33
33
Vic
ictor Devadoss & T. Antony Alphonnse Ligori (2013) Stock
ck Predi
dict
ctio
i n Usin
ng
A. Victor
Prediction
Using
atta M
iningg
Artificial Neural Networks. International Journal of D
Data
Mining
Techniques and Applications. December. Vol. 02, 283-2911

An-Sing Chen, Mark T. Leung and Hazem Daouk (2003) Ap
pplicaati
tion ooff
An-Sing
Application
ecasting aand
ndd
neural networks to an emerging financial market: fore
forecasting
atiions
trading the Taiwan Stock Index. Computers & Operat
Operations
Research 30, 901–923
Appel,
Technical
Analysis
Appel, Gerald
Ger
eral
ald
d (2005).
(2
Tech
chnical Anal
alys
ysiis Power Tools
Too
oolss for Active
Activ
ve Investors.
Investtor
ors..
Financial Times Pr
Prentice
Pren
enti
t ce Hall.
Hal
alll. p. 166. ISBN 0-13-147902-4
W
ite (1994) Comment on artificial
al nneural
eu
ural
Chung-Ming Kuan and Halbert Wh
White
Revi
view
ws 13(1):
13(
3(1):
networks: an econometric perspective. Econometric Re
Reviews
93-97
93-997
93
Da
Suty
Su
tyan
antto (2013)
(20
2013
13)) Investing
Investtin
In
ingg in
in Indonesia:
Ind
ndoones
esia
ia:: a basic
basi
ba
sicc Introd
oduc
ucti
tion
on to the
David
Sutyanto
Introduction
Inndo
donesia Stock Ex
E
changee, April 1. att http://www.indonesiahttp://
//www
w.indonesiai
Indonesia
Exchange,
investments.com
Daniel Svozil, Vladimir Kvasnička,
Kvasnička, Jiĭί Pospίchal(1997) Introduction to
multi-layer feed-forward
feed-fforward neural
neural networks. Chemometrics and
Intelligent Laboratory
Laborato
tory Systems
Systeems 39, 43-62
Eddy F. Putra & Raymondus Kosala
Kosaala (2013) Application of Artificial Neural
Intraday
Networks To Predict In
Int
traday Trading Signals. Recent Researches
iin E-Activities
E A ti iti ISBN:
ISBN 978-1-61804-048-0
978 1 61804 048 0
E. E. Peters, Chaos and order in the capital markets: A new view of cycles,
prices, and market volatility, John Wiley & Sons Inc. (1991).

55

E. GiEord, Investor’s Guide to Technical Analysis: Predicting Price Action
in the Markets, Pitman Publishing, London, 1995.
Tae Hyup Roh (2007) Forecasting the volatility of stock price index. Expert
ppli
liccations,
i
33, 916–922
Systems with App
Applications,
33,
ohd.Sopiyan Baba (2013) Intelligent
Int
ntel
e ligent Decission Support
Jhon Veri and M
Mohd.Sopiyan
Syyst
stem For Prediction Of Indonesia Stockk Exchanges.
Exchanges. IJISI, Vol 1,
System
No. 1, April. ISSN
SN: 2289-3709
No.
ISSN:
ng Tao YAO
AO & Chew
w Li
Lim
m TA
TAN
N (2
(200
001)
1) Guidelines for Financial
Jing
(2001)
Forecaast
s in
ing
g
Netw
Ne
t orks,
avai
ailable
at
Forecasting
with
Neural
Networks,
available
http
ht
t ://www2.cs
cs.ur
uregina.c
i
a//~jty
jtyao
ao/P
/ apers/guid
de_
e_ic
iconip01.p
.pdf
http://www2.cs.uregina.ca/~jtyao/Papers/guide_iconip01.pdf
J. Chang,
Cha
hang
ng, Y. JJung,
ung, K. Yeon, J. Jun, D. Shin, H. Kim,
Ki Technical
Tec
echn
hnic
i al Ind
Indicators
dic
icators
1996.
and
an
d Analysis Methods, Jinritamgu Publishing,
g, Seoul,, 19
1996
96.
J.J. Murphy,
J.
Murphy, Technical Analysis of the Futures Markets: A Comprehensive
Co
omp
mpre
rehensiv
ve
Prentice-Hall,
Guide to Trading Methods and Applications, Pre
ent
n icee-Ha
Hall
ll,, New
w
York, 1986.
K
im Kyoung-jae (2003) Financial time series forecasting us
using su
supp
p or
ort
Kim
support
vector machines. Neurocomputing 55, 307 – 319
Mark T. Leunga, Hazem Daoukb and An-Sing Chen (2000). Foreca
astingg
Mark
Forecasting
timatiion
stock indices: A comparison of classification and levell esti
estimation
modeels
ls. International
Inttern
In
rnat
atio
i nal Journall of F
orrec
ecas
asti
t ng, 16, 173–190.
173––19
190.
models.
Forecasting,
Liao Zhe & Wang Jun (2010)
0). Fo
F
reccasting model of global stock index by
re
(2010).
Forecasting
stochastic time effective
effectiv
ve neural network. Expert Systems wit
th
with
Applications, 37, 834–841
Mahm
Ma
hmoo
ood
d Moein
Moei
Mo
ein
n Aldin
Aldi
Al
dinn et al.,
al., (2012)
(201
(2
012)
2) E
v lu
va
luat
atin
ingg th
thee Em
Empl
ployyme
mennt of
Mahmood
Evaluating
Employment
Teech
chni
nical In
Indi
dicatorss iin
n Pr
Predicti
ting
ng Stock
ck Price
Pri
r ce Index
x V
arria
iations
Technical
Indicators
Predicting
Variations
Usin
ng Artificiall Neural Networks,
Networks, International
Inte
In
t rnat
atio
iona
nall Journal
Jouurnal of
Jo
Using
Business and Management;
Manag
agement;; Vol. 7, No. 15
Business
Manish Kumar & Dr. M. The
Thenmozhi
(2006)
enmozhi (200
06) Support Vector Machines Approach to
Predict the S&P
NIFTY
P CNX N
IFTY Index Returns, available at:
http://ssrn.com/abstract=962833
http://ssrn.com/abstrract=96283
833
Mark Hudson Beale et al. Nuer
Nueral
ral
a Nextwork
Nex
extwork Toolbox - User’s Guide R2013b.

MathWorks
N
j bM
d (2014) P
di i Di
i off S
Pi
IIndex
d M
Najeb
Masoud
Predicting
Direction
Stockk Prices
Movement
Using Artificial Neural Networks: The Case of Libyan Financial
Market. British Journal of Economics, Management & Trade

56

O.E. Barndorff-Nielsen, J.L. Jensen and W.S. Kendall (1993). Networks and
chaos: statistical and probabilistic aspects. London: Chapman and
Hall; 1993.
Sneha Soni (2011) Appl
plic
icat
atiions off AN
ANNs in Stock Market Prediction: A
Applications
International
Survey. In
nte
ternational Journal of Computer
Com
omputer Science & Engineering
Technology.
Techno
nollogy. Vol. 2, Issue.3, 71-83
Ch
se of Neural Network
Suchira Chaigusin
(2011)) An Investigation Into the Use
of the
th Stock
Stoc
St
ockk Exchange
E ch
Ex
change of Thaila
land
n . Edith Cowan
for the Predictionn of
Thailand.
University
Univer
ersi
sity
ty
Ach
hel
elis
i , Technical
Technicaal An
alysi
l is ffrom
rom
m A to
t Z, Probuss P
u lishing, Chicago,
ub
S.B. Achelis,
Analysis
Publishing,
19
1995.
SerSe
r-Hu
H ang
gP
oon (2005) A Practical Guide to Forecasti
ting
n Fin
inan
anci
cial
al Marke
k t
Ser-Huang
Poon
Forecasting
Financial
Market
Volatility. Jhon Wiley and Sons, ltd, England.
Stocck price data (Jan. 2005 - May 2014) of Indonesia Stockk Index
Inddex available
ava
vail
i able
le
Stock
at
https://finance.yahoo.com/q/hp?s=^JKSE&a=00&b=11&c=
=20
2005
05&d
https://finance.yahoo.com/q/hp?s=^JKSE&a=00&b=1&c=2005&d
=04&e=28&f=2014&g=d
Zaiyong
Z
aiyong Tang, C. de Almeida, P. A. Fishwick (1991) Time seriess
methodology.
forecasting using neural networks vs. Box-Jenkins meth
hodolog
ogy.
Simulation 57(5):303-310 from
http
tp:/
://w
/www.resea
earc
rchgate.net//pu
pubblication/
n/24
2429
2 25036_Tiime_seriees_
s_ff
http://www.researchgate.net/publication/242925036_Time_series_f
orecasting_using_neural_networks_vs._Box_Jenkins_methodology
orecasting_using
_neu
neural_
_ne
netw
tworks_vs._Box_Jenkins_methodoolo
logy
gy
Tuan Zea Tan, Chai Quek andd Geok See Ng (2007). Biological
al brainbraain
ininspired genetic complementary learning for stock market
maark
rket
et aand
nd bbank
ank
failure
prediction.
Computational
fail
fa
ilur
uree pr
pred
edic
icti
tion
on.. Co
Computat
atio
iona
nall Intelligence,
Inte
In
tell
llig
igen
ence
ce,, 23(2),
23(2
3(2),
), 2236–261.
36––26
36
2611.
Wy
Wythoff
f BJ.
BJ (1993)
(199
(1
993)
3) Back-propagation
Backk pr
prop
opagattio
ionn ne
neur
u al nnetworks:
etwo
et
w rks:
s: a ttutorial.
utorial.
neural
Ch
hem
emometrics and
d
Chemometrics
Intelligent Laboratory
Laboraatory Systems.
System
ms. 18(2):115-155.
Yakup Kara, Melek Acar B
oyacioglu,, Ömer Kaan Baykan (2011) Predicting
Boyacioglu,
direction of stock
k price ind
ndex movement using artificial neural
index
networks and suppo
ort vecto
tor machines: the sample of the Istanbul
support
vector
Stock Exchange. Expe
pert S
ystems with Applications 38, 5311-5319
Expert
Systems
Yanshan Wang & In-Chan Choi (2013) Market Index and Stock Price
Direction Prediction using Machine Learning Techniques: An
empirical study on the KOSPI and HSI. ScienceDirec. 1-13
Yaser S. Abu-Mostafa & Amir F. Atiya (1996). Introduction to financial
forecasting. Applied Intelligence, 6(3), 205–213.

57

Yochanan Shachmurove and Dorota Witkowska (2000) Utilizing Artificial
Neural Network Model to Predict Stock Markets. The City College
of the City University of New York and The University of
Pennsylvania.
Variable
at
y
http://www.scribd.com/doc/189092644/file
http://www.scr
rib
ibdd.com/doc/18
1890
9092644/file

58

Apendix A: Matlab code
The code below are some of the main part of this research methodology
A. Preprocess code
arg
gout = preproses(varargin)
preproses(var
rar
argin)
function varar
varargout
S M-file for preproses.fig
% PREPROSES
PREPROSES, by itself, creates a new
ew PREPROSES or
%
PREPROSES,
es the existing
g
raises
%
singleton*.
%
PREPR
P OSES returns the
he handle
han
andl
dle
e to a new PREPROSES
PREPROSES
%
H = PREPROSES
he handle
handl
dle to
or the
stin
ing singleton*.
%
the exist
existing
%
PRE
REPROSES('CALLBACK',hObject,even
ntDat
ta,
a,ha
hand
ndle
l s,..
..)
%
PREPROSES('CALLBACK',hObject,eventData,handles,...)
cal
ca
lls the
the local
calls
PREPROSES.
.M with
wi
ith the
the
%
function named CALLBACK in PREPROSES.M
give
ven input arguments.
given
%
s a new
new
%
PREPROSES('Property','Value',...) creates
PREPROSES or raises the
PREPROSES
le
eft,
%
existing singleton*. Starting from the left,
property value pairs are
preproses_Opening
gFcn gets
ts
%
applied to the GUI before preproses_OpeningFcn
called. An
es
%
unrecognized property name or invalid value makes
property application
p
All inputs are passed
pas
asse
sed
d to preproses_OpeningFcn
preproses_O
Ope
peningFc
Fcn
n
%
stop.
All
vara
va
rarg
gin.
via varargin.
%
s on GUIDE's Tools menu. Choose "GUI
"GU
GUI
I
%
*See GUI Options
allows only one
%
instance to run (singleton)".
%
Se also:
also
al
so:
: GUIDE,
GU
UID
IDE
E, GUIDATA,
GUI
UIDA
D TA
A, GUIHANDLES
GUIH
GU
IHAN
ANDL
D ES
% See
Edit the
e above text
tex
ext to modify
modif
ify the response
re
esp
spon
nse to
to help
help
% Edit
prep
pr
epro
ros
ses
preproses
GUIDE v2.5
5 23-Jul-2014 08:15:08
% Last Modified by GUIDE
ion
o code - DO NOT EDIT
% Begin initializati
initialization
gui_Singleton = 1;
struct('gu
ui_Nam
me',
gui_State = struct('gui_Name',
mfilename, ...
'gui
i_Si
ingleton', gui_Singleton, ...
'gui_Singleton',
'gui_
_Op
OpeningFcn', @preproses_OpeningFcn,
'gui_OpeningFcn',
...
'gui_OutputFcn', @preproses_OutputFcn,
...
'gui_LayoutFcn', [] , ...
'gui_Callback',
[]);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

59

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State,
varargin{:});
else
gui_mainfcn(
(gu
gui
i_State, varargin{:});
varar
argi
g n{:});
gui_mainfcn(gui_State,
end
tia
ialization code - DO NOT EDIT
EDI
IT
% End init
initialization

--- Executes just
t before
befo
be
fore
re preproses
pre
repr
pros
oses
e is made visible.
vis
i ible.
% --function preproses_OpeningFcn(hObject,
pre
repr
pro
oses_O
Ope
peni
ning
n Fc
Fcn(
n hO
hObj
b ec
ect,
t, eventdata,
eventdata
a, handles,
function
varargin)
is function has
ha
as no output
outpu
tput
t args,
ar
Ou
utp
tput
u Fcn.
% This
see OutputFcn.
hObj
hO
bjec
e t
handle to figure
% hObject
handle
even
entdat
ta reserved - to be defined in
i a future
fut
utur
ure version
versio
i n
% ev
eventdata
MATLA
AB
of MATLAB
% handles
structure with handles and user
hand
dles
er data
dat
ata
a (see
(s
GUIDATA)
GUID
DATA)
varargin
prepros
ses (see
(se
see
e
% varargin
command line arguments to preproses
VA
ARARGIN)
VARARGIN)
preprose
es
% Choose default command line output for preproses
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
mak
akes
es preproses
pre
repr
p oses wait for
for user
user response (see
(se
see
e
% UIWAIT makes
UIRESUME)
UIRESU
SUME
ME)
)
% uiwait(handles.figure1);
uiwait(handles.figur
ure1
e );
;
% --- Outputs from this function are returned to the
command line.
function
functi
tion varargout
varar
argo
gout
ut = preproses_OutputFcn(hObject,
prepros
ses
es_O
Out
utpu
putFcn(h
(hOb
Object,
,
eventdata,
even
ev
entd
tdat
ata
a, handles)
han
andl
dles)
)
% varargout
vararg
rgou
out
t cell
cel
ell
l array
y for
for returning
retu
turn
rnin
i g output
outp
ou
tput args (see
(see
VARARGOUT);
VARA
VA
RARG
RGO
OUT)
T);
;
% hObject
handle to figure
hObj
hO
bje
ect
figur
ure
% eventdata reserved
d - to be
be defined in a future version
of MATLAB
% handles
structure
structu
ure with handles
handles and user data (see
GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
handles.o
. ut
tput;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
% handles
structure with handles and user data (see
GUIDATA)

60

global stock1 stock
format short g, format compact
stock=xlsread('table.xls','sheet1','mydata1');
t=handles.uitable1;
set(t, Data ,stock);
set(t,'Data',stock);
set(t,'Columnname',{'AD'
{
I' 'LW%R' 'MACD' 'Mom' 'Roc'
set(t,'Columnname',{'AD'
'CCI'
'S
Sto
toch.K%' 'MA%k-D%' 'MA%D-%D'
'M
'RSI' 'SMA' 'Stoch.K%'
'WMA'});
t=handles.ui
uitable2;
t=handles.uitable2;
stock1=[
[];
stock1=[];
i=
=1:size(stock,2
, )-1
for i=1:size(stock,2)-1
nor
orma
mali
lisa
sasi
si(s
(stock(:,i),-1,1)
1 ];
stock1=[stock1 normalisasi(stock(:,i),-1,1)];
en
nd
end
stock1=[st
toc
ock
k1 stock(:,end)];
stock
k(:,end)];
stock1=[stock1
set(t,
t,'Data'
a',stock1);
set(t,'Data',stock1);
set(
t(t,
t 'C
' olumnnam
me'
e',{'AD' 'CCI' 'LW%R'
'LW
L %R' 'MACD'
'MAC
CD' 'Mom' 'Roc'
'Ro
R c'
set(t,'Columnname',{'AD'
'R
RSI
S ' 'SMA'
'SMA' 'Stoch.K%'
'Stoch.K%' 'MA%k-D%' 'MA%D-%D'
'MA%
A%D-%D'
' 'WMA'});
'WMA
'W
MA'});
'RSI'
save mydata
mydat
ata stock stock1
save
--- Executes
Ex
pushbutt
ton2.
% --on button press in pushbutton2.
f ncti
fu
tion pushbutton2_Callback(hObject, eventdata,
event
ntdata
a, handles)
ha
s)
function
hO
)
% hObject
handle to pushbutton2 (see GCBO)
ventdata reserved - to be defined in a future
fut
tur
u e version
vers
ve
rsion
% e
eventdata
of MATLAB
% handles
structure with handles and user data
dat
ta (see
(s
see
GUIDATA)
close(preproses)

% --- Executes on button press in pushbutton3.
hand
ndles)
)
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject
handle
han
andl
dle
e to pushbutton3
pushbut
tto
ton3
n3 (see
(se
see
e GCBO)
entd
tdat
ata
a reserved
res
eser
erved
d - to be
be defined
defi
de
fine
ned
d in a future
future version
n
% even
eventdata
of MATLAB
% handles
structure with
wit
ith handles and user data (see
GUIDATA)

B. Training
T ainiing ccode
Tr
ode
od
function
n varargout
varargout = training(varargin)
training(
g(varargin)
% TRAINING M-file for training.fig
trainin
ing.fig
%
TRAINING, by itself,
a new TRAINING or raises
itself, creates
cr
the
%
existing singleton*.
singl
leton*.
%
%
H = TRAINING returns
re
eturns the handle to a new TRAINING or
the
handle to the existing
exis
i ti
ting singleton*.
%
%
TRAINING('CALLBACK',hObject,eventData,handles,...)
TRAINING('CALLBACK'
K ,hObject,eventData,handles,
)
calls the
%
local function named CALLBACK in TRAINING.M with the
given
input arguments.
%

61

%
TRAINING('Property','Value',...) creates a new
TRAINING or
%
raises the existing singleton*. Starting from the
left,
%
property value pairs
p irs are applied to the GUI before
pa
training_OpeningFcn
training_OpeningFc
cn gets called.
calle
ed. An
%
unrecognized
unrecog
gni
nized property name or invalid value makes
property application
app
ppl
lication
%
stop.
sto
top. All inputs are passed to training_OpeningFcn
tra
raining_OpeningFcn
via varargin.
va
arargin.
%
%
*See
e GUI
GUI Options
Opti
ion
ons
s on
n GUIDE's
GUI
IDE
E's
s Tools
Tools menu. Choose "GUI
allows
allows only
y one
one
%
instance
insta
anc
nce to run (singleton)".
%
% See
GUIDE,
GUIDATA, GUIHANDLES
See also:
al
GU
GUIHANDL
LES
% Edit
the
Ed
the above text to modify the response
se to help
help
training
traini
tr
ning
% Last
Last Modified by GUIDE v2.5 12-Aug-2014 06:57:57
06:57:5
: 7
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton,
, ...
'gui_OpeningFcn', @training_OpeningFcn,
@training_Open
ningFcn
n,
...
'gui_OutputFcn', @training_OutputFcn,
@training_Outp
putF
tFcn,
...
'gui_LayoutFcn',
'gu
gui_
i Layo
yout
utFc
Fcn'
n', []
[] , ...
'gui_Callback',
[]);
'gui_
i_Ca
all
llback',
if nargin && ischar(varargin{1})
ischar(vararg
rgin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
en
if nargout
t
[varargout{1:nargout}]
[var
[v
arar
argout
ut{1
{1:nar
argout
t}] = gui_mainfcn(gui_State,
gui
ui_mai
ainf
nfcn(g
(gui
ui_State
S te,
,
varargin{:});
varargin{:
{:}
});
else
el
lse
gui_mainfcn(gui_State,
gui_mainfcn(gui_S
State, varargin{:});
var
arargin{:});
end
% End initialization code - DO
O NOT EDIT
% --- Executes just before
be
efore training
training is made visible.
function training_OpeningFcn(hObject,
training_Openin
i gFcn
cn(hObject, eventdata, handles,
varargin)
% This function has no output
out
utput args, see OutputFcn.
% hObject
handle to figure
fig
i ure
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see
GUIDATA)
% varargin
command line arguments to training (see
VARARGIN)

62

% Choose default command line output for training
handles.output = hObject;
global stock stock1
load mydata
str
tructure
% Update handles structure
guidata(hObjec
ct, handles);
guidata(hObject,
T makes training
train
ning wait for user response
resp
pon
o se (see
% UIWAIT
UIRESU
UME)
UIRESUME)
uiwait(handles.fig
ui
gur
ure1
e1);
;
% uiwait(handles.figure1);
Output
uts from
fr
ar
re returned
returned to the
h command
% --- Outputs
this function are
line.
func
ncti
tion
on varargout
varar
rgout = training_OutputFcn(hObject,
training_Output
utFc
F n(hObj
bjec
ect,
t, eventdata,
event
tdata,
function
handles)
hand
ha
ndle
les)
% varargout
vararg
va
gout cell array for returning output
outp
tput args
arg
rgs
s (see
(s
VARARGOUT);
VAR
VA
RARG
GOUT);
% hObject
handle to figure
hOb
bject
% eventdata
ev
ventdata reserved - to be defined in a future
fut
ture version
vers
ve
rsion of
MATLAB
MA
ATLAB
% handles
structure with handles and user data
a (see
e
GUIDATA)
GUIDATA)
% Get default command line output from handles structure
stru
ucture
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject,
pushbut
utto
t n1_Callback(hObj
bjec
ect,
, eventdata, handles)
hand
ha
ndles)
% hObject
handle to pushbutton1
hObj
jec
ect
t
pushbut
utton1 (see GCBO)
GCBO
GC
BO)
% eventdata reserved
reserve
ed - to be
be defined
defined in a future version
n of
MATLAB
structure wit
i h handles and user data (see
e
% handles
with
GUIDATA)
% load
load mydata
myd
ydat
ata
a
% %create
%cre
%c
reat
ate architecture
ar
rch
chit
tec
ectu
ture
re
% PT=P;
global
glob
gl
obal
al net
net y Pn
Pn T stock1
st
1
nil=str2num(get(handles.edit13,'string'))-2004;
nil=str2
2nu
num(get(handle
les.edit13
13,'string'))
)-20
2 04;
dataall=stock1;
tabel={'37-36:245-36,:'
tabel={'37-36:245-36,
,:'
'245-36+1:490-36,:'
'245-36+1:490-36,:'
'490-36+1:740-36,:'
'490-36+1:740-36,:'
'740-36+1:983-36,:'
'740-36+1:983-36
3 ,:'
'983-36+1:1226-36,:'
'983-36+1:1226-36,:'
'1226-36+1:1471-36,:'
'1226-36+1:1471-36,:'
'
'1471-36+1:1718-36,:'
'1471-36+1:1718-36
3 ,:
:'
'1718-36+1:1863-36,:'
'1718-36+1:1863-36
6,:'
'1863-36+1:2202-36,:'
'1863-36+1:2202-36
6 :'
'2202-36+1:2300-36,:'};
cmd=['data=dataall(' tabel{nil} ');'];
eval(cmd);
% P=data(:,1:end-1)';
% T=data(:,end)';
Pn=data(1:end-1,1:end-1)';

63

T=data(2:end,end)';
save data Pn T data
nh=str2num(get(handles.edit4,'string'));
net = newff(minmax(Pn),[nh 1],{ 'tansig'
purelin }, traingdx );
'purelin'},'traingdx');
e train
train
%inisialize before
ne
net.LW{2,1} = net.LW{2,1}*0.01;
net.b{2}*0.01;
net.b{2} = net.b{2}*0.01;
net.perfor
ormFcn = 'sse'; %e
net.performFcn
EPOCH=st
str2num(get(ha
handles.edit7,'string'));
EPOCH=str2num(get(handles.edit7,'string'));
net.
.trainParam.epoch
hs =EPOCH
=EPO
=E
OCH ;%10000;
;%1
100
0 00; %parameter
%paramet
eter epoch
net.trainParam.epochs
ne
et.trainPar
a am
am.g
.goal = str2num(get(handles.edit9,'string'));
str2
st
2nu
um(
(ge
et(
(ha
handles.edit9,
9 'string'));
net.trainParam.goal
LR=str2num(g
(get
et(h
handl
les.edit5,'
'st
stri
ring
ng')
'));
)
LR=str2num(get(handles.edit5,'string'));
net.tr
rai
a nPar
ram
am.lr=LR;
net.trainParam.lr=LR;
net.tr
trai
ainParam.sho
how = 1000;
net.trainParam.show
MC=s
=str
tr2n
2num(g
get
et(handles.edit6,'string')
'));
)
MC=str2num(get(handles.edit6,'string'));
net.
ne
t.tr
trainP
Param.mc = MC; %momentum koefisien
koefis
sie
i n
net.trainParam.mc
net.
ne
t.trai
inParam.time=20*60;
net.trainParam.time=20*60;
net.tr
ne
rainParam.min_grad=1e-50;
net.trainParam.min_grad=1e-50;
o train
% do
[net
et,tr,Y,E,Pf,Af] = train(net,Pn,T);
[net,tr,Y,E,Pf,Af]
y=
=sim(net,Pn);
y=sim(net,Pn);
yt
yt=[];
for i=1:length(y)
for
yt(i)=fth(y(i));
end
hasil=[(1:length(T))' T' y' yt'];
t=handles.uitable1;
set(t,'Data',hasil);
set(t,'Columnnam
a e'
e ,{'Day' 'Actual' 'Predicted' 'Up/Down'});
'Up/D
/Do
own'});
set(t,'Columnname',{'Day'
set(t,'C
Col
olumnwidth',{3
{30 50 50
0 75});
set(t,'Columnwidth',{30
MAE=sum(abs(T'-yt')
))/
)/le
leng
n th
h(T
(T')
');
MAE=sum(abs(T'-yt'))/length(T');
set(handles.edit1,'strin
ng'
g ,MAE);
set(handles.edit1,'string',MAE);
%versi one
RMSE=sqrt(mse(T'-yt')); %versi
set(handles.edit2,'string',RMSE);
MAPE
MA
PE=s
=sum
um(a
(abs
bs(T
(T'-yt
yt')
))/length(T')
);
MAPE=sum(abs(T'-yt'))/length(T');
set(
se
t(ha
hand
ndle
les.ed
edit
t8,
8,'s
'str
trin
ing',M
,MAP
APE)
E);
;
set(handles.edit8,'string',MAPE);
SSE=sse(T
T-yt
yt)
);
SSE=sse(T-yt);
SST=
SS
T ss
sse(
e(T
T-me
ean(T));
SST=sse(T-mean(T));
R2=1-(SSE
SE/
/SST);
R2=1-(SSE/SST);
set(handles.edit3,'str
ring',R
R2)
2 ;
set(handles.edit3,'string',R2);
tot=0;
for i=1:length(y)
if T(i)==yt(i)
tot=tot+1;
end
end
PR=tot/length(yt);
set(handles.edit10,'string
ng',PR);
set(handles.edit10,'string',PR);
Pstat=ranksum(T yt);
Pstat=ranksum(T,yt);
set(handles.edit15,'string',Pstat);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton2 (see GCBO)

64

% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see
GUIDATA)
close(training)
edit1
1_Callback(hObject,
C
eve
vent
n data, handles)
function edit1_Callback(hObject,
eventdata,
GCBO
O)
% hObject
handle to edit1 (see GCBO)
% eventdata
eventd
data reserved - to be defined in a future version of
MATLAB
B
% handles
structure
ha
andles
structu
ure
e with
wit
th handles
hand
ha
dle
les and user data
dat
a a (see
GUIDATA)
GU
UIDATA)
% Hints:
Hint
ts: get(hObject,'String')
get
t(hObject
t,'
, St
Stri
ring
ng')
) returns
s contents
conte
tent
nts of edit1
edi
d t1 as
text
t
%
str2double(get(hObject,'String'))
str
tr2
2double(get(hObject,'Strin
ng'
g')) returns
ret
etur
urns
n contents
cont
tents
of edit1
edit1 as a double
% --- Executes during object creation, after setting
setti
ing all
all
properties.
prop
operties.
function
fu
unction edit1_CreateFcn(hObject, eventdata, handles)
han
ndles
es)
% hObject
handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version
vers
rsio
ion of
MATLAB
% handles
empty - handles not created until after
afte
er all
CreateFcns called
% Hint: edit controls usually have a white background
backgrou
und on
Windows.
%
See
See ISPC and
nd COMPUTER.
R.
if ispc && isequal(get(hObject,'BackgroundColor'),
isequal(g
l(get
et(h
( Obje
ject
ct,'B
'BackgroundC
dColor'),
get(0,'defaultUicontrolBackgroundColor'))
get(0,'defaultUicontrolB
lBac
ckg
kgroundColor'))
set(hObject,'BackgroundColor','white');
set(hObject,'Backgroun
undColor','white');
end
function
func
fu
ncti
tion
on edit2_Callback(hObject,
edi
dit2
t2_C
_Cal
allb
lbac
ack(
k(hObj
bjec
ect,
t, eventdata,
eve
v nt
tda
data
ta,
, handles)
hand
ha
ndle
les)
s)
% hObject
handle to
t
o edit2
edi
dit2
t2 (see GCBO)
GCBO
BO)
)
% eventdata
even
ev
entd
tdat
ata reserved
reserve
ved - to be defined
de
d in
i a future
fut
utur
ure
e version
vers
ve
sion of
MATLAB
% handles
structure
e with handles
h ndles and user data (see
ha
GUIDATA)
% Hints: get(hObject,'String')
get(hObject,
,'String')
) returns contents of edit2 as
text
%
str2double(get(hObject,'String'))
str2double(ge
et(hObj
ject,'String')) returns contents
of edit2 as a double
% --- Executes during object
obje
ject creation, after setting all
properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called

65

% Hint: edit controls usually have a white background on
Windows.
%
See ISPC and COMPUTER.
isequal(get(h
(hOb
Obje
ject, BackgroundColor ),
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUico
cont
ntrolBackgroun
undC
d olor'))
get(0,'defaultUicontrolBackgroundColor'))
set(hObjec
ct,'BackgroundColor','w
'whi
h te');
set(hObject,'BackgroundColor','white');
end
functi
ion edit3_Callback(hObject,
edit3_Callb
back(hObject, eventdata, handles)
h ndles)
ha
function
hOb
hO
bject
o edit3
edi
it3 (see
(se
ee GCBO)
G BO)
GC
% hObject
handle to
a reserved
res
eserve
ed - to
o be
be defined
defi
de
ine
ed in
i a future
futur
re version of
% eventdata
MATLAB
MATLAB
dle
les
structu
ure with
wit
ith
h handles
ha
an
nd user
er data (see
(s
see
e
% hand
handles
structure
and
GUID
IDAT
ATA)
A)
GUIDATA)
Hi
: get(hObject,'String') returns contents
con
ontents
s of edit3
edit3
3 as
% Hints:
te
text
ret
eturns
s contents
con
ontents
s
%
str2double(get(hObject,'String')) returns
edit3 as a double
of edit3
sett
ting
g all
ll
% --- Executes during object creation, after setting
properties.
properties.
handl
les)
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit3 (see GCBO)
version of
f
% eventdata reserved - to be defined in a future version
MATLAB
afte
er all
al
ll
% handles
empty - handles not created until after
CreateFcns called
control
ols
s usually
usuall
us
lly
y have
have a white background on
% Hint: edit controls
Windows.
COMPU
P TER.
%
See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
ge
et(
t(0,
0,'d
def
efau
ault
ltUi
Uico
cont
n rolBackgroun
undC
dCol
olor
or')
))
get(0,'defaultUicontrolBackgroundColor'))
set(
se
t(hO
hObj
bjec
e t,
t,'B
Bac
ackg
kgro
roundC
dCol
olor
or',
,'whi
hite
te')
');
;
set(hObject,'BackgroundColor','white');
end
f nction
fu
on edit4_Callbac
ck(hObje
ect, eventdata,
eventdata
ta, handles)
handle
les)
s)
function
edit4_Callback(hObject,
o edit4
4 (see GCBO)
% hObject
handle to
d - to be defined in a future version of
% eventdata reserved
MATLAB
structur
re with handles
ha
% handles
structure
and user data (see
GUIDATA)
get(hObject,'St
Strin
ng') returns contents of edit4 as
% Hints: get(hObject,'String')
text
str2double(get(hO
hObject,'String')) returns contents
%
str2double(get(hObject,'String'))
of edit4 as a double
% --- Executes during object creation, after setting all
properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit4 (see GCBO)

66

% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty - handles not created until after all
CreateFcns called
contr
trol
ols usually have
hav a white background on
% Hint: edit controls
Windows.
e ISPC and COMPUTER.
%
See
if ispc &&
&& isequal(get(hObject,'BackgroundColor'),
isequal(get(hObject,'Background
ndColor'),
get(0,'defaultUicontrolBackgroundColor'))
get(0,
,'defaultUicont
ntrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
set(hObject,'Bac
ckg
gro
oun
ndC
dCol
olor
r',
,'white');
end
en
nd
function
functi
ion edit5_Callback(hObject,
edi
it5_Callb
bac
ack(
k(hO
hObj
bjec
ect,
, eventdata,
event
tdata,
, handles)
ha
)
% hObject
handle
hObj
hO
bjec
ect
han
and
dle to edit5 (see GCBO)
GC
% eventdata
even
ev
ntdata
a reserved - to be defined in
i a future
fut
utur
ure
e version
versio
i n of
MATLAB
MATL
MA
TLA
AB
% handles
structure with handles and user
handle
les
er data
dat
ta (see
(se
GUIDATA)
GUIDAT
GU
ATA)
% Hints:
Hints: get(hObject,'String') returns contents of edit5
edi
it5 as
text
te
ext
%
str2double(get(hObject,'String')) returns
s contents
con
onte
tents
of edit5 as a double
% --- Executes during object creation, after setting
settin
ng all
properties.
function edit5_CreateFcn(hObject, eventdata, handles)
handle
es)
% hObject
handle to edit5 (see GCBO)
% eventdata
in a future version
eventdat
ata
a reserved
reserve
ed - to be
e defined
de
version of
MATLAB
% handles
empty - handles
ha
andle
les not created until after all
l
CreateFcns called
% Hint:
Hint
Hi
nt:
: edit
edit controls
con
ontr
trol
o s usually have
have a white
whi
hite
te background
bac
ackg
kgroun
nd on
Windows.
Wind
Wi
ndow
ows
s.
%
See
See ISPC
ISPC and COMPUTER.
COM
OMPU
PUTE
TER
R.
if ispc
isp
spc
c &&
&& isequal(get(hObject,'BackgroundColor'),
isequal(g
(get(h
hOb
Object
t,'Back
'
kgr
grou
o nd
ndCo
Colo
lor'
r ),
get(0,'defaultUicontrolBackgroundColor'))
g t(0,'d
ge
def
efaultUicontro
rolBackgr
roundColor'))
)
set(hObject,'BackgroundColor','white');
set(hObject,'Backg
groundC
Col
o or','white');
end
function edit6_Callback(hObject,
edit6_Callba
ack(hObjec
ct, eventdata, handles)
% hObject
handle to edit6 (see GCBO)
% eventdata reserved - to be
be defined in a future version of
MATLAB
% handles
structure with
wit
th handles and user data (see
GUIDATA)
% Hints: get(hObject,'String') returns contents of edit6 as
text
%
str2double(get(hObject,'String')) returns contents
of edit6 as a double

67

% --- Executes during object creation, after setting all
properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
empty
emp
mpty - handles not created
cr
rea
e ted until after all
CreateFcns called
called
% Hint
Hint:
controls
t: edit control
ols usually have a white background
bac
a kground on
Windows.
Wind
dows.
%
See
e ISPC
ISPC and
d COMPUTER.
COM
OMPU
UTE
ER.
if
if ispc && isequal(get(hObject,'BackgroundColor'),
ise
sequ
qual(get(hObject,'
'Ba
Back
ckgr
gro
oundColor'),
get(0,'defaultUicontrolBackgroundColor'))
get(0,
,'d
' efau
ult
l Uicontro
olB
lBac
ackg
kgroundColor
r'))
set(hObject,'BackgroundColor','white');
set(
se
t(hObject,
t,'B
'BackgroundColor'
','white');
;
end
d
function
fun
fu
nction
on edit7_Callback(hObject, eventdata, handles)
hand
dle
les)
s)
% hObject
handle to edit7 (see GCBO)
hObj
bject
% eventdata
ev
ventdata reserved - to be defined in a future
fut
tur
u e version
vers
ve
rsion of
MATLAB
MAT
TLAB
% handles
structure with handles and user data
a (see
e
GUIDATA)
GUIDATA)
% Hints: get(hObject,'String') returns contents of edit7 as
s
text
%
str2double(get(hObject,'String')) returns contents
conten
nts
of edit7 as a double
% --- Executes
Exec
ecut
utes during
durin
ing
g object creation,
creation, after
aft
fter setting
settin
ng all
properties.
properties.
i
function edit7_CreateFcn(hObject,
edit7_CreateFcn
cn(h
hOb
Object, eventdata, handles)
% hObject
handle to edit7
edi
dit7 (see GCBO)
% eventdata reserved - to be defined in a future version
vers
rsio
ion
n of
of
MATLAB
MATL
MA
TLAB
% handles
empty
hand
ha
ndle
les
s
emp
mpty
ty - handles
handle
ha
es not
not created
crea
eate
ted
d until
unti
un
til
l after
afte
af
ter
r all
all
CreateFcns
s called
cal
alled
% Hint: edit
controls
ed
s usually
y have a white
whi
ite background
backgroun
und
d on
Windows.
%
See ISPC and COMPUTER.
R.
if ispc && isequal(get(hObject,'BackgroundColor'),
isequal(ge
et(hObject
t,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
get(0,'defaultUicontr
rolBackgro
oundColor'))
set(hObject,'BackgroundColor','white');
set(hObject,'Backg
kgroundCo
olor','white');
end
function edit8_Callback(hObject,
edit8_Callback(
(hO
Object, eventdata, handles)
% hObject
handle to edit8
edi
dit8 (see GCBO)
% eventdata
reserved
version
of
td t
d - to
t be
b defined
d fi d in
i a future
f t
i
f
MATLAB
% handles
structure with handles and user data (see
GUIDATA)
% Hints: get(hObject,'String') returns contents of edit8 as
text

68

%
str2double(get(hObject,'String')) returns contents
of edit8 as a double
% --- Executes during object creation, after setting all
properties.
function edit8_CreateFcn(hObject,
edit8_Cre
reat
ateFcn(hObject
ct,
, eventdata, handles)
handle to edit8 (see GCBO)
GCBO
GC
B )
% hObject
handle
a reserved - to be defined in a future version of
% eventdata
MATLAB
% handles
hand
dles
empty - handles not created until
unti
til after all
CreateFcns
Crea
ateFcns called
% Hint: edit
it controls
con
ontrols usually have a white
wh
hite background
backgro
oun
u d on
Window
ws.
Windows.
%
See ISPC
PC and COMPUTER.
if ispc
isp
spc && isequal(get(hObject,'BackgroundColor'),
isequal(get(hObject,'Backgr
rou
o ndColo
lor'
r'),
)
get(0,'defaultUicontrolBackgroundColor'))
get(
ge
t(0
0,'d
def
efaultUicontrolBackgroundColor'))
)
set(hObject,'BackgroundColor','white');
set(
t(hObject,'BackgroundColor','white');
;
end
en
fu
unction edit9_Callback(hObject, eventdata, handles)
hand
dles)
s)
function
% hObject
handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version
vers
rsio
ion of
MATLAB
% handles
structure with handles and user data (see
GUIDATA)
% Hints: get(hObject,'String') returns contents of edit9
t9 as
text
%
str2double(get(hObject,'String'))
str
tr2double(
e(ge
get(hObjec
ect
t,'String'
g'))
)) returns contents
content
ts
of edit9
edit9
9 as a double
double
ble
obje
j ct creation, after setting all
all
% --- Executes during object
properties.
function
edit9_CreateFcn(hObject,
func
fu
ncti
tion
on e
dit9
di
t9_Cre
Creat
a eFcn(hObject
ct,
, eventdata,
even
ev
entd
tdat
ata,
a, handles)
han
andl
dles
s)
% hObject
handle
hObj
hO
bjec
ect
t
han
ndl
dle
e to edit9
edit9
t9 (see
(se
see
e GCBO)
G BO
GC
O)
% eventdata
eventdat
ata
a reserved - to be
be defined
d in a future version
ve
ers
rsio
ion of
MATLAB
MATL
MA
TLAB
AB
% handles
empty - handles
after
handle
les
s
h ndles not created
ha
d until
un
afte
er all
CreateFcns called
% Hint: edit controls
s usually have a white background on
Windows.
%
See ISPC and COMPUTER.
COMPUTER
R.
if ispc && isequal(get(hObject,'BackgroundColor'),
isequal(get
t(hObje
ect,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
get(0,'defaultUicontrol
lBackg
kgroundColor'))
set(hObject,'BackgroundColor','white');
set(hObject,'Backgro
oun
ndColor','white');
end
function edit10_Callback(hObject, eventdata, handles)
% hObject
handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see
GUIDATA)

69

% Hints: get(hObject,'String') returns contents of edit10 as
text
%
str2double(get(hObject,'String')) returns contents
of edit10 as a double
es during object creation,
creatio
on, after setting all
% --- Executes
properties
s.
properties.
n edit10_CreateFcn(hObject,
edit10_Crea
ateFcn(hObject, eventdata,
eventda
data
t , handles)
function
hObj
bject
% hObject
handle to edit10 (see GCBO)
ev
reserve
ed - to
o be
be defined
de
efi
ine
n d in a future
fut
tur
u e version of
% eventdata
reserved
MA
MATLAB
emp
mpty - handles not created
cr
rea
ate
ted until after
afte
ter all
% handles
empty
Create
eFcns called
called
CreateFcns
Hint
Hi
nt: edit
ed
dit controls usually have a white
whi
hite background
bac
ackg
kgro
r und on
% Hint:
Wind
Wi
ndows.
Windows.
%
See ISPC and COMPUTER.
spc && isequal(get(hObject,'BackgroundColor'),
isequal(get(hObject,'BackgroundColo
lor'),
,
if is
ispc
get(0,'defaultUicontrolBackgroundColor'))
get(
t(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
en
nd
function edit11_Callback(hObject, eventdata, handles)
handl
les)
% hObject
handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version
version of
f
MATLAB
% handles
structure with handles and user data (see
(see
GUIDATA)
% Hints: get(hObject,'String')
get(hObject
ct,'
,'St
String
ng')
') returns contents of edit11
1 as
text
str2double(get(hO
h bject,'String')) returns contents
con
nte
tent
nts
s
%
str2double(get(hObject,'String'))
of edit11 as a double
% --- Executes
Exec
Ex
ecut
utes
e during
dur
urin
ing
g object
obje
ob
ect creation,
cre
reat
atio
ion,
n, after
aft
fter
er setting
set
etti
tin
ng all
all
properties.
properties
es.
.
function
func
fu
ncti
tion
on edit11_CreateFcn(hObject,
edi
dit
t11_Crea
ateFcn(
(hObj
ject, eventdata,
eve
ent
n da
ata
ta,
, handles)
hand
ha
ndle
les)
s)
hObj
jec
ect
t
1 (see GCBO)
% hObject
handle to edit11
% eventdata reserved - to be
be defined in a future version of
MATLAB
% handles
empty - handles not
not created until after all
CreateFcns called
% Hint: edit controls usually
u uall
us
ly have a white background on
Windows.
%
See ISPC and COMPUTER.
COM
MPU
UTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
isequal(get(hOb
Object,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject
handle to popupmenu1 (see GCBO)

70

% eventdata
MATLAB
% handles
GUIDATA)

reserved - to be defined in a future version of
structure with handles and user data (see

s = get(hObject,'String')
get(hObject,
t 'String') returns popupmenu1
% Hints: contents
contents as cell
ce
ell array
con
ontents{get(hObject,'Value')}
} returns selected
%
contents{get(hObject,'Value')}
item from
fro
om popupmenu1
% ----- Executes during
durin
ng object
ob
bje
ect creation,
cre
eat
tion, after setting
set
e ting all
properties.
pr
.
function popupmenu1_CreateFcn(hObject,
pop
opup
pme
menu1_CreateFcn(hObj
bjec
e t, eventdata, handles)
h ndles)
ha
hObj
jec
ect
pop
opup
upme
menu1 (see
e GCBO)
O)
% hObject
handle to popupmenu1
% eventdata
ev
ven
entd
tdata reserved
res
eserved - to be defined
defi
fine
ned in a future
fut
utur
u e version
vers
rsion of
MATLAB
MATL
TLAB
B
% handles
empty - handles not created until
ha
s
u til
un
l after
afte
af
ter all
l
CreateFcns
Cre
Cr
eateFc
Fcns called
% Hint:
popupmenu controls usually have a white
Hi
whit
te background
back
ckgr
ground
on
n Windows.
%
See ISPC and COMPUTER.
if
if ispc && isequal(get(hObject,'BackgroundColor'),
,
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit12_Callback(hObject, eventdata, handles)
handle
es)
% hObject
handle to edit12 (see GCBO)
% eventdata
in a future version
eventdat
ata
a reserved
reserve
ed - to be
e defined
de
version of
MATLAB
% handles
structure with
wit
th handles and user data (see
GUIDATA)
% Hints:
Hint
Hi
nts:
s: get(hObject,'String')
get
et(h
(hOb
Obje
ject
c ,'String') returns
ret
etur
urns
ns contents
con
onte
tent
nts
s of edit12
edi
dit1
t12
2 as
text
text
%
str2double(get(hObject,'String'))
str
tr2
2double(ge
et(
t(hO
hObj
bject,'Strin
ing'
g'))
)) returns contents
con
onte
tents
of edit12
edi
dit1
t12
2 as
s a double
doubl
ble
% --- Executes during
g object
t creation, after setting all
properties.
function edit12_CreateFcn(hObject,
edit12_Creat
teFcn(hObj
ject, eventdata, handles)
% hObject
handle to
to edit12 (see GCBO)
% eventdata reserved
d - to be
e defined in a future version of
MATLAB
% handles
empty - handles
ha
andle
es not created until after all
CreateFcns called
% Hint: edit controls usually have a white background on
Windows.
%
See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

71

function edit13_Callback(hObject, eventdata, handles)
% hObject
handle to edit13 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
struc
uctu
ture with handles
hand
ndle
l s and user data (see
% handles
structure
GUIDATA)
: get(hObject,'String')
get(hObject
t,'String') returns contents
con
nte
t nts of edit13 as
% Hints:
text
str2double(
(ge
get(
(hO
Obj
bjec
ect,
,'S
Str
t ing')) returns
ret
tur
u ns cont