Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

plot multiple lines in a graph

5 visualizzazioni (ultimi 30 giorni)
Gabriel Maya
Gabriel Maya il 7 Mar 2016
Chiuso: Walter Roberson il 7 Mar 2016
Hi, my code is the following:
%%Initialize variables.
workDir='C:\Users\gabri\Desktop\Nova_pasta\Arquivos_Saida_Imex';
for i=1:25
cd(workDir);
pasta= ['cd ' num2str(i) ];
eval (pasta)
delimiter = '\t';
startRow = 6;
formatSpec = '%f%f%f%f%[^\n\r]';
%%Open the text file.
fileID = fopen('arqanepi.rwo','r');
dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'HeaderLines' ,startRow-1, 'ReturnOnError', false);
%%Close the text file.
fclose(fileID);
%%Allocate imported array to column variable names
days(:,i) = dataArray{:, 1};
Oil(:,i) = dataArray{:, 2};
Gas(:,i) = dataArray{:, 3};
Water(:,i)= dataArray{:, 4};
cd (workDir)
end
plot(days(:,1), Oil(:,1))
hold on
for i=2:25
plot(days(:,i), Oil(:,i))
hold off
end
I have a problem in the plotting phase. I only get a single line of oil x days.
Can someone help me to plot all 25 lines of Oil in one single graph of oil x days?
Thanks in Advance !

Risposte (0)

Questa domanda è chiusa.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by