フィルターのクリア

Add additional information to data cursors

1 回表示 (過去 30 日間)
J
J 2015 年 8 月 18 日
Hello, I would like to add additional information to my data cursors on a plot I have. My code currently looks like this:
fig = figure('name','Flight Profile');
plot(TrkDistAbsInstr, interpolated.MSMC.Profiles(:), 'o')
xlabel('Track Distance [Nm]');
ylabel('Flight Level');
title('Flight Profile');
grid on
dcm = datacursormode(fig);
set(dcm, 'UpdateFcn', @ATCInstructionsDataCursorFunction, 'SnapToDataVertex', 'on');
datacursormode on % sets the mouse to default to a data cursor
Where the code for ATCInstructionsDataCursorFunction is:
function [output_txt] = ATCInstructionsDataCursorFunction(~,event_obj)
pos = get(event_obj, 'Position');
idx3 = get(event_obj, 'DataIndex');
output_txt = {['Track Distance [Nm]: ',num2str(pos(1))],...
['Flight Level: ',num2str(pos(2))],...
['Instruction Index: ',num2str(idx3)]};
end
This gives me a dataplot with the Track Distance, Flight Level and Index on the datacursor. I would like to add additional information to the datacursor, that I have stored in another structure, EFPS_Combined.action
How can I get say,
EFPS_Combined.action(x) % where x = 1:17
To display the value of EFPS_Combined.action(x) on the xth datapoint?

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by