Creating Table from csv files.
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have 5 csv files in a folder. all these csv files have multiple column with names like x,y,u,v....
I want to plot all u (In this case total 5 u will be there from five csv file) values in Matlab.
I am able to read and extract the column that contain u value from these csv files but not able to store it in array so that i can plot them on the same axis.
Can you please help!
Any help will be appreciated!
my code is
Folder='C:\Users\user\Desktop\7-19-22'
mat = dir(fullfile(Folder, '*.csv'));
disp(mat)
for files_i = 1:length(mat)
disp(mat(files_i).name)
data = fullfile(Folder,mat(files_i).name);
ReadCSV(data,files_i);
end
arr [];
function s = ReadCSV(data,i)
opts = detectImportOptions(data)
opts.SelectedVariableNames = {'u'};
T = readtable(data,opts);
disp(T)
end
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!