How to apply a transformation with makehgtform()?

7 views (last 30 days)
I would like to learn how to apply transformations with makehgtform(). This is toy example:
% Create a red octagon using the fill function.
t = (1/16:1/8:1)'*2*pi;
x = cos(t);
y = sin(t);
fill(x,y,'r');
Now instead of x=x/2 and y=y/2 and replot, I would like to apply makehgtform('scale',0.5), but how to use it? how to plot the new octagon?

Answers (1)

Mike Garrity
Mike Garrity on 30 Sep 2015
I just put a post up on the MATLAB graphics blog that covers the two different ways you can use that matrix, and quite a lot of the theory behind the 4x4 representation.
  6 Comments
Mr M.
Mr M. on 30 Sep 2015
no, the first five lines make this error!
Mr M.
Mr M. on 30 Sep 2015
so my version has the makehgtform() function, but I cannot figure out how to use it :(

Sign in to comment.

Categories

Find more on Specifying Target for Graphics Output 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!