MATLAB: Quick question regarding CSV file reading.

arraycolumcolumscsvMATLABreadreadtablerowssensortable

I have two csv files with only one colum each. I want to extract only the first number (measurement counter) and Sensor output last (V), i dont care about the water temp. The second file has less measurements (rows) than the first, so i need to chop out some measurements (rows). Preferably i want to start from a specific row, for example row 3-9 in CSVfile1 and row 4-8 in CSVfile2. Can anyone explain how i could do this, if its even possible?
I also need to plot the two tables/arrays in a same graph.
Best regards,
-Ben

Best Answer

hello
my quick suggestion to the quick question
fid=fopen('cycle1.csv');
e=textscan(fid,'%s','headerlines',1);
e_splitted = split(e{1},',');
outdata = cellfun(@str2num,strrep(e_splitted, '"', '')); % remove double quotes & convert string to num
% get my Counter and Sensor_Output data
start_row = 3;
stop_row = 9;
Counter_Output = outdata(start_row:stop_row,1);
Sensor_Output = outdata(start_row:stop_row,2);