Can You Help Me ? :'(

4 次查看(过去 30 天)
juhdi Ramdhoni
juhdi Ramdhoni 2013-12-16
function varargout = learning(varargin)
% LEARNING MATLAB code for learning.fig
% LEARNING, by itself, creates a new LEARNING or raises the existing
% singleton*.
%
% H = LEARNING returns the handle to a new LEARNING or the handle to
% the existing singleton*.
%
% LEARNING('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in LEARNING.M with the given input arguments.
%
% LEARNING('Property','Value',...) creates a new LEARNING or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before learning_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to learning_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
% Edit the above text to modify the response to help learning
% Last Modified by GUIDE v2.5 18-Nov-2013 08:23:28
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @learning_OpeningFcn, ...
'gui_OutputFcn', @learning_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 learning is made visible.
function learning_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 learning (see VARARGIN)
% Choose default command line output for learning
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes learning wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = learning_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 datalatih.
function datalatih_Callback(hObject, eventdata, handles)
% hObject handle to datalatih (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
datalatih=uigetfile('*.dat','ambil data latih');
datalatih=load(datalatih);
handles.datalatih=datalatih;
guidata(hObject,handles)
% --- Executes on button press in target.
function target_Callback(hObject, eventdata, handles)
% hObject handle to target (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
target=uigetfile('*.dat','ambil data target');
target=load(target);
handles.target=target;
guidata(hObject,handles)
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
net = newff(handles.datalatih,handles.target,[25 1]);
net.Param = train(net,handles.datalatih,handles.target);
simpan = uiputfile('*.mat','simpan hasil pelatihan')
save(simpan)
Code Error:
Error using trainlm (line 109)
Inputs and targets have different numbers of samples.
Error in network/train (line 106)
[net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
Error in learning>pushbutton3_Callback (line 102)
net.Param = train(net,handles.datalatih,handles.target);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in learning (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)learning('pushbutton3_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
helpUtils.errorDocCallback('@(hObject,eventdata)learning('pushbutton3_Callback',hObject,eventdata,guidata(hObject))')
|
Error: Unexpected MATLAB expression.

采纳的回答

Walter Roberson
Walter Roberson 2013-12-17
Please show us size(handles.datalatih) and size(handles.target)
To do this, at the MATLAB command line give the command
dbstop if error
and then run your program. When it stops you can investigate the values. You might need to use
dbup
a couple of times to get back to your callback.

更多回答(1 个)

juhdi Ramdhoni
juhdi Ramdhoni 2013-12-17
this's my file bro. i can't , please help me
  2 个评论
Walter Roberson
Walter Roberson 2013-12-17
You did not include your files and you did not indicate size(handles.datalatih) or size(handles.target) so we cannot be of further assistance as yet.
juhdi Ramdhoni
juhdi Ramdhoni 2013-12-19
i'm so sorry . which one?
% --- Executes on button press in datalatih. function datalatih_Callback(hObject, eventdata, handles) % hObject handle to datalatih (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) datalatih=uigetfile('*.dat','ambil data latih'); datalatih=load(datalatih); handles.datalatih=datalatih; guidata(hObject,handles)
% --- Executes on button press in target. function target_Callback(hObject, eventdata, handles) % hObject handle to target (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) target=uigetfile('*.dat','ambil data target'); target=load(target); handles.target=target; guidata(hObject,handles)
% --- Executes on button press in start. function start_Callback(hObject, eventdata, handles) % hObject handle to start (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) net = newff(handles.datalatih,handles.target,[25 1]); net = train(net, handles.datalatih, handles.target); simpan = uiputfile('*.mat','simpan hasil pelatihan'); save(simpan)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by