MATLAB: Doing calculation across columns

mathMATLABsimple

Hi there. I have a 4 column by 500 row matrix. How would I add a fifth column that calculates , where x is the corresponding value in the second column across the same row.
Thanks!

Best Answer

D=zeros(500,5);
D=matrix;
D(:,5)=exp((-(matrix(:,2)-75)/2).^2)