dlmCalc - %usage dlmCalc(fn data = csvread(fn%reads in the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function dlmCalc(fn) % Given a comma-seperated file containing an Mx2 array of doubles, write a % function dlmCalc that adds a third column to the original array. The third % column should be the product of first and second columns. Then, write the % new array to a tab-seperated file. The new filename should be the % original filename with the suffix '_edited.txt'.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %usage: dlmCalc(fn) data = csvread(fn); %reads in the data from the csv file col = prod(data')'; %creates a column vector of the product of the columns data = [data col]; %concatenates the original data array with the newly created column vector dlmwrite([fn '_edited.txt'],data);...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.

Ask a homework question - tutors are online