MATLAB: Large For Loop Executing Slowly

for loop

I'm performing what I believe to be a relatively simple trigonometric calculation on a large (35000×6) matrix, and producing a 35000 entry vector. However, the way Matlab is performing this seems to be to calculating one entry in the final vector, returning the entire vector, and then repeating this process for every calculation. It's been running for twenty minutes and is not close to being done. I assume there is some more efficient way to code this, but I am currently at a loss.
The code in question:
filename = 'matlab drift bb slab.xlsx'
data = xlsread(filename)
drift1 = zeros(1,35000)
drifto = atan((data(1,1)-data(1,4))/(data(1,2)-data(1,5)))
for n = (1:35000)
drift1(n) = atan((data(n,1)-data(n,4))/(data(n,2)-data(n,5)))-drifto
end
Is there a more efficient way to accomplish this?

Best Answer

Terminating your lines with semi-colons would really help. Without them, they dump loads of crapola to the screen on EVERY iteration. The time required to dump an entire vector with 35000 elements in it to the screen, and to do it 35000 times is significant!