function varargout = rbf(varargin)
% RBF M-file for rbf.fig
% RBF, by itself, creates a new RBF or raises the existing
% singleton*.
%
% H = RBF returns the handle to a new RBF or the handle to
% the existing singleton*.
%
% RBF('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RBF.M with the given input arguments.
%
% RBF('Property','Value',...) creates a new RBF or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before rbf_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to rbf_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help rbf
% Last Modified by GUIDE v2.5 25-Nov-2009 20:56:55
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @rbf_OpeningFcn, ...
'gui_OutputFcn', @rbf_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before rbf is made visible.
function rbf_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% 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 rbf (see VARARGIN)
t=date;
set(handles.edit_time,'String',t);
handles.Ht=t;
% Choose default command line output for rbf
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes rbf wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = rbf_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in button_updata.
function button_updata_Callback(hObject, eventdata, handles)
num=cell(1,1);
num{1,1}=get(handles.edit_num,'String');
t=handles.Ht;
yahoo_url=yahoo;
price_sclose1=fetch(yahoo_url,num{1,1},'close','01/01/09',t);
price_sopen1=fetch(yahoo_url,num{1,1},'open','01/01/09',t);
price_sopen1=price_sopen1(:,2);
price_sclose1=price_sclose1(:,2);
n=size(price_sclose1);
for i=1:1:n(1)
price_sclose(n(1)-i+1,1)=price_sclose1(i,1);
price_sopen(n(1)-i+1,1)=price_sopen1(i,1);
end
save price_sclose;
save price_sopen;
% --- Executes on button press in button_k.
function button_k_Callback(hObject, eventdata, handles)
% --- Executes on button press in button_future.
function button_future_Callback(hObject, eventdata, handles)%§§
if isempty(get(handles.edit_num,'String'))
msgbox('请输入代码')
return
end
load price_sclose
load price_sopen
k=size(price_sclose);
yclose=myrbf(price_sclose);
yopen=myrbf(price_sopen);
axes(handles.axes_close)
cla
x=[6:1:k(1)+1];
plot(x,yclose,'b');
title('收盘价')
hold on
grid on
axes(handles.axes_open)
cla
plot(x,yopen,'b');
hold on
grid on
% --- Executes on button press in button_real.
function button_real_Callback(hObject, eventdata, handles)%
%price_sclose=handles.Hprice_sclose;
if isempty(get(handles.edit_num,'String'))
msgbox('请输入代码')
return
end
load price_sclose;
load price_sopen;
axes(handles.axes_close)
plot(price_sclose,'r')
grid on
hold on
axes(handles.axes_open)
plot(price_sopen,'r');
title('开盘价')
hold on
grid on
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function edit_time_Callback(hObject, eventdata, handles)
% hObject handle to edit_time (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_time as text
% str2double(get(hObject,'String')) returns contents of edit_time as a double
% --- Executes during object creation, after setting all properties.
function edit_time_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_time (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function edit_num_Callback(hObject, eventdata, handles)
% hObject handle to edit_num (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_num as text
% str2double(get(hObject,'String')) returns contents of edit_num as a double
% --- Executes during object creation, after setting all properties.
function edit_num_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_num (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end