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

New to MATLAB?

Thread Subject:
vectorization of rotation script

Subject: vectorization of rotation script

From: m4 Chrennikov

Date: 14 Mar, 2011 15:42:05

Message: 1 of 1

Hi guys, i'm trying to vectorize my rotation script. For scalar pair of angles theta and fi script looks like that:

rot1=[cos(theta) -sin(theta) 0;sin(theta) cos(theta) 0;0 0 1];
rot1=rot1*[cos(fi) 0 sin(fi);0 1 0;-sin(fi) 0 cos(fi)];

[x;y;z] is vertices coordinate matrix of parallelogram, it has 3x8 size.
Now I want to create some code that can work with vectors theta and fi, which have 1xN against of 1x1 size.
Any ideas how to do it w/o any loops?

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