Azzera filtri
Azzera filtri

Plotting data from table iteratively

1 visualizzazione (ultimi 30 giorni)
Stefano Alberti
Stefano Alberti il 9 Giu 2020
Hi everyone,
I created this code to import data from csv file. Inside the csv files, the rows are depths and columns are dates.
I need to create a part of code plotting the data from table, asking input date/dates to user.
In the part of code with variablesName I save the name of columns (date but not as datetime), I have not clear how to plot the data specifying the column/columns.
Thanks,
directory = '/Users/SA/Data';
S = dir(fullfile(directory,'*.csv'));
for k = 1:numel(S)
F = fullfile(directory,S(k).name);
S(k).data = readtable(F, 'PreserveVariableNames', true, 'ReadVariableNames', true);
end
% Read variables name inside the structure and save array
variablesName = fieldnames(S(1).data);
date_COR_0200 = variablesName';
variablesName = fieldnames(S(2).data);
date_COR_0287 = variablesName';
variablesName = fieldnames(S(3).data);
date_COR_0315 = variablesName';
COR_0200 = S(1).data;
COR_0287 = S(2).data;
COR_0315 = S(3).data;

Risposte (0)

Categorie

Scopri di più su Tables in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by