MATLAB: My equation in for loop with 180 iterations is only giving me one answer

foriterationsupdating functions

I am using matlab online so can not attach file, here is my code.
Though a is a 1×180 vector my t only has one output. How do I fix this?
My graph is giving me a horizontal line at 0.9152
anglei=90;
a=linspace(0,180,180);
T=zeros(numel(a));
for n=1:numel(a)
t=((tan(anglei)-tan(a))/(tan(anglei)+tan(a)));
T(:,n)=t;
end
plot(T,a)
axis([0 180 0 1])

Best Answer

You don't need a loop:
anglei=90;
a=linspace(0,180,180);
t=(tan(anglei)-tan(a))./(tan(anglei)+tan(a));
plot(t,a)