How can I link a plot to an array in a structure to use data brushing? Maybe a bug?

2 views (last 30 days)
Hi,
i want to link data in plot to the data in an array which is contained in a structure to use data brushing. Consider the following simple example:
v.C=rand(100,3);
v.X=v.C(:,1);
v.Y=v.C(:,2);
v.Z=v.C(:,3);
C=v.C;
plot3(v.X,v.Y,v.Z,'XDataSource','v.X','YDataSource','v.Y','ZDataSource','v.Z');brush on; linkdata; openvar('v.X');
plot3(C(:,1),C(:,2),C(:,3),'XDataSource','C(:,1)','YDataSource','C(:,2)','ZDataSource','C(:,3)');brush on; linkdata; openvar('C'); openvar('C(:,1)');
plot3(v.C(:,1),v.C(:,2),v.C(:,3),'XDataSource','v.C(:,1)','YDataSource','v.C(:,2)','ZDataSource','v.C(:,3)');brush on; linkdata; openvar('v.C'); openvar('v.C(:,1)');
The first and second plot works. If I brush data in the plot, the same points get marked in the variable editor. If I change the variable in the editor the plot gets updated.
However, the third plot does not work. If brush the data in the plot, no data is marked in the variable editor. Nevertheless, changing the data in the variable editor results in an correct update of the plot.
Is there a solution to this problem. Maybe it has something to do with this comment from the Matlab help (<http://www.mathworks.de/de/help/matlab/ref/linkdata.html?searchHighlight=%27YDataSource%27>)
" Note: Although you can use data brushing on linked plots of complex data, your brush marks only appear in the plot you are brushing, not in other plots or in the Variables editor. This is because function calls, such as real(x) and imag(x), that you specify as data sources are not interpreted when brushing graphed data. "
Best regards
  3 Comments
OCDER
OCDER on 4 Oct 2017
Edited: OCDER on 4 Oct 2017
Looks like a bug to me, since it's behaving unexpectedly. Have you tried submitting this to the MathWorks bug report page?
While they get that looked into, you may have to just stick to your workaround solutions.
Csaba
Csaba on 5 Oct 2017
I have sent a bug report.
Workaround is ugly in my case. I have to name individually all my structure vector, and the structure vector has indefinite size.

Sign in to comment.

Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!