You are Here: Home >< Maths

# Matlab Matrices Linear Transformation Code watch

1. This is the code i am using the object it plots the shape of a house. From scaling3y to shear2y I can't get the code to work. I have been told the I have to change the matrices coordinates like [2 0;0 1] for scaling2x. Can you help complete the code so it worls in matlab.

% Linear Transformations
clc,close all,clear;
% Object to be transformed is a house
obj=[0 0;0 1;1 2;2 1;2 0;3 0;7/4 0;7/4 1/2;5/4 1/2;5/4 0;-1 0]'
I=eye(2);
%Transformation Matrices
scaling2x=[2 0;0 1];

scaling3y
rotate45
reflectx-axis
reflecty-axis
reflecty=x
reflecty=-x
shear3x
shear2y

%Call to function lintr2 to print output
lintr2(obj,scaling2x)
hold on

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: February 9, 2017
Today on TSR

### Summer Bucket List is Back!

Start yours and you could win £150!

Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams