1

I'm working on a matlab project:

enter image description here

We just started matlab, we haven't had any tutorials, just projects. We were giving a handout for it but it doesn't help. I'm really confused about this

Drew U
  • 199
  • If you did not code in Matlab before, just start with simple things. Search youtube for example: https://www.youtube.com/watch?v=jTS5ZmrrzMs This course series seems ok to me. If you'll have to use Matlab a lot, you have to learn it and in order to do this you need to do lots of simple examples. It is really easy, once you know the basic commands, but don't expect a magic recipe. Learning needs work, as always. Of course, it is not enough to read or watch tutorials. You need to do the actual coding yourself for a course to be useful. – Beni Bogosel Jul 06 '18 at 09:43

1 Answers1

1
function drawpattern(theta,n)
d = theta*pi/180; %convert to radians
R=[cos(d) sin(d); -sin(d) cos(d)];
p_last=[0;0];
x=zeros(1,n+1);
y=x;
figure;
hold on;
for i=1:n+1
    x(i)=p_last(1);
    y(i)=p_last(2);
    p_last=p_last+R^(i-1)*[i;0];
end
plot(x,y)
axis('equal')
box on

enter image description here

enter image description here

enter image description here

msm
  • 7,147