Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
zoom

Subject: zoom

From: shopana

Date: 29 Jan, 2008 08:41:02

Message: 1 of 7

hi,
  i want to zoom in and zoom out the axis with help of
slider.i.e., by moving the slider position min to max.Is
this posible.can somone help me? Thanks a lot.

Subject: zoom

From: Vihang Patil

Date: 29 Jan, 2008 09:01:03

Message: 2 of 7

"shopana " <shopana.e@hcl.in> wrote in message
<fnmoqu$3sv$1@fred.mathworks.com>...
> hi,
> i want to zoom in and zoom out the axis with help of
> slider.i.e., by moving the slider position min to max.Is
> this posible.can somone help me? Thanks a lot.

doc zoom
use zoom(factor) in your slider function
HTH
Vihang

Subject: zoom

From: shopana

Date: 29 Jan, 2008 09:16:02

Message: 3 of 7

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fnmq0f$h6j$1@fred.mathworks.com>...
> "shopana " <shopana.e@hcl.in> wrote in message
> <fnmoqu$3sv$1@fred.mathworks.com>...
> > hi,
> > i want to zoom in and zoom out the axis with help of
> > slider.i.e., by moving the slider position min to
max.Is
> > this posible.can somone help me? Thanks a lot.
>
> doc zoom
> use zoom(factor) in your slider function
> HTH
> Vihang


thanks for your speedy reply.can you give me simple
example in slider using zoom(factor).

Subject: zoom

From: Vihang Patil

Date: 29 Jan, 2008 10:52:02

Message: 4 of 7

"shopana " <shopana.e@hcl.in> wrote in message <fnmqsi$s79
> thanks for your speedy reply.can you give me simple
> example in slider using zoom(factor).

Example:

function slidertp
load clown
h = figure,imshow(X,map);
h1 = uicontrol('Style','Slider','Callback',{@myzoom,h});

function myzoom(obj,event,h)
val = get(obj,'Value');
if isempty(get(obj,'UserData'))
    val_temp = val;
    set(obj,'UserData',val_temp);
else
    val_temp = get(obj,'UserData');
end
if val>=val_temp
    zoom(h,1.01);%zoom factor
    val_temp = val;
    set(obj,'UserData',val_temp);
else
    zoom(h,0.99);%zoom factor
    val_temp = val;
    set(obj,'UserData',val_temp);
end


HTH
Vihang

Subject: zoom

From: shopana

Date: 12 Feb, 2008 11:48:02

Message: 5 of 7

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fnn0gi$4ll$1@fred.mathworks.com>...
> "shopana " <shopana.e@hcl.in> wrote in message
<fnmqsi$s79
> > thanks for your speedy reply.can you give me simple
> > example in slider using zoom(factor).
>
> Example:
>
> function slidertp
> load clown
> h = figure,imshow(X,map);
> h1 = uicontrol('Style','Slider','Callback',{@myzoom,h});
>
> function myzoom(obj,event,h)
> val = get(obj,'Value');
> if isempty(get(obj,'UserData'))
> val_temp = val;
> set(obj,'UserData',val_temp);
> else
> val_temp = get(obj,'UserData');
> end
> if val>=val_temp
> zoom(h,1.01);%zoom factor
> val_temp = val;
> set(obj,'UserData',val_temp);
> else
> zoom(h,0.99);%zoom factor
> val_temp = val;
> set(obj,'UserData',val_temp);
> end
>
>
> HTH
> Vihang


its working fine.In the same slider how can i make it to
zoom only horizontally by some factor?

Subject: zoom

From: Vihang Patil

Date: 12 Feb, 2008 12:04:01

Message: 6 of 7

"shopana " <shopana.e@hcl.in> wrote in message <fos11i$ra5
$1@fred.mathworks.com>...
> "Vihang Patil" <vihang_patil@yahoo.com> wrote in message
> <fnn0gi$4ll$1@fred.mathworks.com>...
> > "shopana " <shopana.e@hcl.in> wrote in message
> <fnmqsi$s79
> > > thanks for your speedy reply.can you give me simple
> > > example in slider using zoom(factor).
> >
> > Example:
> >
> > function slidertp
> > load clown
> > h = figure,imshow(X,map);
> > h1 = uicontrol('Style','Slider','Callback',
{@myzoom,h});
> >
> > function myzoom(obj,event,h)
> > val = get(obj,'Value');
> > if isempty(get(obj,'UserData'))
> > val_temp = val;
> > set(obj,'UserData',val_temp);
> > else
> > val_temp = get(obj,'UserData');
> > end
> > if val>=val_temp
> > zoom(h,1.01);%zoom factor
> > val_temp = val;
> > set(obj,'UserData',val_temp);
> > else
> > zoom(h,0.99);%zoom factor
> > val_temp = val;
> > set(obj,'UserData',val_temp);
> > end
> >
> >
> > HTH
> > Vihang
>
>
> its working fine.In the same slider how can i make it to
> zoom only horizontally by some factor?


doc zoom
zoom xon
zoom yon

Vihang

Subject: zoom

From: shopana

Date: 12 Feb, 2008 12:26:01

Message: 7 of 7

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fos1vh$8ng$1@fred.mathworks.com>...
> "shopana " <shopana.e@hcl.in> wrote in message
<fos11i$ra5
> $1@fred.mathworks.com>...
> > "Vihang Patil" <vihang_patil@yahoo.com> wrote in
message
> > <fnn0gi$4ll$1@fred.mathworks.com>...
> > > "shopana " <shopana.e@hcl.in> wrote in message
> > <fnmqsi$s79
> > > > thanks for your speedy reply.can you give me
simple
> > > > example in slider using zoom(factor).
> > >
> > > Example:
> > >
> > > function slidertp
> > > load clown
> > > h = figure,imshow(X,map);
> > > h1 = uicontrol('Style','Slider','Callback',
> {@myzoom,h});
> > >
> > > function myzoom(obj,event,h)
> > > val = get(obj,'Value');
> > > if isempty(get(obj,'UserData'))
> > > val_temp = val;
> > > set(obj,'UserData',val_temp);
> > > else
> > > val_temp = get(obj,'UserData');
> > > end
> > > if val>=val_temp
> > > zoom(h,1.01);%zoom factor
> > > val_temp = val;
> > > set(obj,'UserData',val_temp);
> > > else
> > > zoom(h,0.99);%zoom factor
> > > val_temp = val;
> > > set(obj,'UserData',val_temp);
> > > end
> > >
> > >
> > > HTH
> > > Vihang
> >
> >
> > its working fine.In the same slider how can i make it
to
> > zoom only horizontally by some factor?
>
>
> doc zoom
> zoom xon
> zoom yon
>
> Vihang


if i use Zoom xon,we cant make it to zoom by some factor
say(0.5x,1x,etc,..)by itself.
i ve one axes and 4 push buttons, when i click the first
button the axes will zoom(horizonally) by 0.5%,second
button 1%,third button 2%,then forth button 4%... is this
possible?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us