how can i add on a graph a point with it's data on gui? like here in excel picture

1 view (last 30 days)
i have got a graph with a lot of temperatures i need to find a stady temperature (shown on graph added) and mentiond it. there could be several temperature points on each curve. when we made it on excel we did it by eye and put a point on the value temperature.but here we need to find by average of at list 20 data cells. and do it on gui like something likre this
<<
>>

Answers (1)

Geoff Hayes
Geoff Hayes on 9 Jun 2014
Have you added a callback to your graph button? Because it is within this callback that you will want to read the data from the Excel file (see xlsread) and then plot columns 2-4. An example could be
function btnGraph_Callback(hObject, eventdata, handles)
% hObject handle to btnChangeMarkupColour (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% read the data from the Excel file
data = xlsread('excelFileData.xlsx');
% get the handle to the axes/plot from the handles object
ha = handles.axes1; % example only, the name for your axes may be different
% set the current axes
axes(ha);
% plot the data (use hold on for multiple plots on same set of axes)
hold on;
plot(data(:,2),'b');
plot(data(:,3),'r');
plot(data(:,4),'g');
You will need to write some additional code to determine the steady state(s) for each set of temperature data.
  1 Comment
Ben11
Ben11 on 9 Jun 2014
and you can use a text annotation in the code Geoff suggested if you want to write the data on the plot.
eg: text(x,y,'You text'); where x and y are the coordinates of the text box enclosing the text between ''.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!