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

1 次查看(过去 30 天)
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
<<
>>

回答(1 个)

Geoff Hayes
Geoff Hayes 2014-6-9
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 个评论
Ben11
Ben11 2014-6-9
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 ''.

请先登录,再进行评论。

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by