Sorry dpb I am not using csvread to read the file as I have a directory of thousands of files and therefore i am using following code to read them. I only want to plot 1st column of the each file something like Plot(Data(:,1)) and I dont wanna use other columns. Please check the code below for me let me know what error I am making or how can I fix it
close all
clear all
clc
loadingDir = '/Users/OP/Desktop/Data/DataChar/TestType/Voltage';
processedFiles = dir(fullfile(loadingDir,'*.csv'));
numOfFiles=size(processedFiles);
for k= numOfFiles :-1:1
y=processedFiles(k).name
temp1=importdata(fullfile(loadingDir,y));
Data=temp1.data;
lenTot = length(Data(:,1));
hL= plot(Data(:,1))
hold all % using it to see whether it is adding?
for i=2:length(k) % loop over the rest
y=processedFiles(k(i).name);
lenTot=lenTot+length(y); % increment cumulative length
set(gca,'xdata',[1:lenTot],'ydata',[get(hL,'ydata').' y(Data(:,1)]);
end
end
Regards