MATLAB: How to manupulate each element of a colum from .csv file

arraycsv

I have a comma saperate .csv text file. I want to use each element of a single column one by one as input to my function. What I should do to achive that. I know c/c++ but Matlab is bit new to me. Please help

Best Answer

Try this
myData = csvread(fullFileName);
% Get one element into a new variable
element38 = myData(3, 8);
% Get the whole column 4
col4 = myData(:, 4);
% Assign element at row 5, column 2 to a new value of pi.
myData(5, 2) = pi;
% Pass each element of column 6 to a function myfun():
for k = 1 : size(myData, 1)
thisElement = myData(k, 6);
someResult(k) = myfun(thisElement);
end