GUI + Reference to non-existent field 'axes1'.
Show older comments
hi all.
I'm working on a project, where i load data ind by "importdata". I want to plot some funktion from these data.
I have created a funktion that open a direction and select a file from this.
this funkion is created like this:
function handles = RoboTrainer( handles )
[filename, pathname] = ...
uigetfile({'*dat'},'File Selector');
[Time,Position,Velocity,RoboForce,AppliedForce,Repetition] =... importfile(fullfile(pathname, filename));
%% GUI variables
handles.MyData.Time = Time;
handles.MyData.Position = Position;
handles.MyData.Velocity = Velocity;
handles.MyData.RoboForce = RoboForce;
handles.MyData.AppliedForce = AppliedForce;
handles.MyData.Repetition = Repetition;
end
I have another function that has to plot a funktion from Time and Position.
function handles = TimePosition( handles )
Sample = length( handles.MyData.Time );
tid=linspace(0,(Sample*0.05),Sample);
axes(handles.axes1);
plot(tid,handles.MyData.Position);
ylabel ('position'); xlabel ('tid/sek'); title ('Position');
end
In my GUI i have created a axes (named axes1).
function axes1_CreateFcn(hObject, eventdata, handles)
handles = RoboTrainer( handles );
guidata(hObject, handles);
handles = TimePosition( handles );
guidata(hObject, handles);
but when i run my GUI, i got this error: "Reference to non-existent field 'axes1'." i don know what I make wrongly?
is there anyone to help me please?
i did not know how to explain the problem without explain all my code :(.
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!