MATLAB: How to multiply the column in matlab..

Here i have attached the Excel file, in this i should calculate the column 2 and column 3 has to be multiply.so, for that i need some commands, please help me friends.

Best Answer

Just use the : operator in the row position to collect all rows and a specific column number in the column position. NB: also that * is matrix multiplication so if you want the element-wise multiplication as would presume from the question you do, you have to use the "dot" operator .*
p=x(:,2).*x(:,3);
assuming the array read from Excel is in variable x
See the help page on Arithmetic Operators under the Language Fundamentals section in *Getting Started" section or
doc times % for direct link from command line for details