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