How to load several and multiple files and plot them?

Dear community
I´m working with multiple data and I´d want to plot:
One specific column from every files v/s time.
Every file is according with one day specific.
How can I plot them by using a loop?
Thanks in advance!

4 commentaires

Jonathan Bijman
Jonathan Bijman le 25 Mai 2019
Modifié(e) : per isakson le 25 Mai 2019
I did this:
clc
clear all
% Specify the folder where the files live.
myFolder = 'C:\Users\jonat\Desktop\Clean';
% Check to make sure that folder actually exists. Warn user if it doesn't.
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
% Get a list of all files in the folder with the desired file name pattern.
filePattern = fullfile(myFolder, '*.jpg'); % Change to whatever pattern you need.
theFiles = dir(filePattern);
for k = 1 : length(theFiles)
baseFileName = theFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
num= xlsread ('C:\Users\jonat\Desktop\Clean');
Voc = num (:,5);
fecha = num (:,1);
plot (Voc,fecha)
end
But I don´t get the plot of that. What can I do?
Comments
  • xlsread() doesn't read jpg-files
  • file name missing in xlsread ('C:\Users\jonat\Desktop\Clean')
Thank U!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by