I have to plot multiple graphs on the same plot reading .sgl files ; the code i have is as follows; I am not sure how to make it read every file in turn; thanks

for i=1:size(filelist,1) sgl=read_hsgl_riff('P*.sgl'); sgl.format; sgl.data; x=sgl.data(:,1); y=sgl.data(:,2); plot(x,y); hold on; end

Risposte (1)

If filelist is a cell array of your filenames, use
for i = 1:numel(filelist9
sgl=read_hsgl_riff(filelist{i});
% more code here
end

1 Commento

My files are in a folder among other non sgl files that I do not want to read;so I wrote this out of the loop filelist = dir( [ DIRECTORY, '/P*.sgl' ] ); i get this error "Cell contents reference from a non-cell array object "

Accedi per commentare.

Categorie

Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange

Richiesto:

RB
il 20 Lug 2016

Commentato:

RB
il 20 Lug 2016

Community Treasure Hunt

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

Start Hunting!

Translated by