An update, i should have done a bit of research before posting. Don't know why i didn't assume matlab would have an automatic way to link axes. I have used the linkaxes function to link the left and right axes together and it worked. However, i still would like to apply the (-50,50) as my standard y min and y max. So for example i have the billateral muscles that are linked and have y min and ymax values as (-20,20).
I have a tiled plot and the two plots in question are tiles 1 and 2 with corresponding ax1 and ax2 variables:
% Tile 1
ax1=nexttile
p1=plot(ChannelTitle,LUTbandpass);
xlim([xlim1 xlim2])
% Tile 2
ax2=nexttile
p2=plot(ChannelTitle,RUTbandpass);
xlim([xlim1 xlim2])
linkaxes([ax1 ax2],'y')
The column vectors LUTbandpass and RUTbandpass are what i want to find the max and min of and figure out if either is below the +/- 50 and if so, want to set the y axis to (-50,50)
Hope that makes sense.
Thank you