I generate two histogram plots that I would like to link to the data in my workspace:
x = -4:0.1:4;y = randn(1000,2);figuresubplot(2,1,1)hist(y(:,1),x)subplot(2,1,2)hist(y(:,2),x)
I try to use LINKDATA but it does not link the data correctly because the data plotted on the histograms is part of a matrix.
linkdata ony = randn(1000,2);
When I was using the PLOT command I was able to specify the 'YDataSource' of the plot and that would specify the data linking:
figureplot(y(:,1),'YdataSource','y(:,1)')linkdata ony = randn(1000,2);
However, I cannot use the same approach for my problem because the histogram object does not seem to have the 'YDataSource' property. I would like to use the LINKDATA function and not the Data Linking tool in the figure toolbar.
Best Answer