Clear Filters
Clear Filters

Plotting data from table iteratively

1 view (last 30 days)
Stefano Alberti
Stefano Alberti on 9 Jun 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;

Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!