Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to program a function in Matlab that will scale and rotate any given set of (x,y) coordinates and then shift that to

I am trying to program a function in Matlab that will scale and rotate any given set of (x,y) coordinates and then shift that to a desired location. I cant get this to work, looking for some input. Thanks image text in transcribed
% XY is a (2xn) ma t rix of coordinates % 3F is the scaling factor t make the plot larger r smaller % r is the r tati n angle, amoun t to rotate the object % shiftx determines how many units to move in the x axis % shifty determines h w many units t move in the y axis ] function XY Lname F1 ni t ia ll.project1(XY,sF, r, shiftx, shifty)2 2 Rotation ma trix R= [c sd (r) -sind (r) ; sind (r) cosd (r) ] ; XY R XY ; % this line r tates the variables XY- SF * XY ; % this lines scales the c ordinates | XY (1, :)=XY (1, :) + shiftx; % shifts the first row in the x axis XY (2, :)-Y (2, :) + shifty; % shifts the second row in the y axis end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions