Plot in uitabgroup (matlab GUI) -


suppose have 3 functions

  1. f(x)=2x+4
  2. h(x)=2x+5
  3. g(x)=2x+6

i have 3 uitabs belong each function.

when user input x data,

  e.g x=[1;2;3;4] 

for each uitab, want see this:

1st uitab:

plot (x,2.*x+4); 

2nd uitab:

plot (x,2.*x+5);  

3rd uitab:

plot (x,2.*x+6);  

my question:

  1. how plot graph simultaneously each uitab?

  2. and how make sure when user change input, new graph shown , not overlap old one?

thanks!!

for each tab, want explicitly create axes , specify parent of plot.

group = uitabgroup();  tab1 = uitab(group, 'title', 'tab1'); tab2 = uitab(group, 'title', 'tab2'); tab3 = uitab(group, 'title', 'tab3');  hax1 = axes('parent', tab1); hax2 = axes('parent', tab2); hax3 = axes('parent', tab3);  plot1 = plot(x, 2.*x + 4, 'parent', hax1); plot2 = plot(x, 2.*x + 5, 'parent', hax2); plot3 = plot(x, 2.*x + 6, 'parent', hax3); 

then when alter value of x can explicitly update these plots

set(plot1, 'xdata', x, 'ydata', 2.*x + 4); set(plot2, 'xdata', x, 'ydata', 2.*x + 5); set(plot3, 'xdata', x, 'ydata', 2.*x + 6); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -