MATLAB Answers


Why Does "linkdata on" Fail on the First Figure When Activated from Code

Asked by Chris
on 9 Jul 2012
I have code that grabs a data stream and bring it into matlab as a structure in the base workspace. To display this data I have a GUI that users can use to created 'linked plots.' However, the first time I create a plot after starting up matlab the linking fails.
"linkdata on" is executed in the code, and the linkdata banner shows up on the figure, and Link Data is checked under the Tools drop down menu. But the plot does not update with the data.
I can force the plot to update by unchecking/checking Link Data in the Tools menu. Linking also starts if I bring up a matlab editor window. But until one of these actions is performed the plots will not update. After I start the first plot updating all the rest will update as expected without intervention.
I'd appreciate any ideas. I even thought of adding a 'Fix Linking" button to the GUI that would simply cycle linkdata, but cycling lindata from the command line does not fix the issue, it appears to need sopmeone to actively click on the figure to cycle Link Data.

  1 Comment

so I added a check to see if it's the first time a linked plot was brought up and if it is I open an editor then close it. Seems to work, not great but I'm out of ideas, and no one else seems to have any either.

Sign in to comment.

0 Answers