Guest
Hi,
I've coded a few lines and I have some problems.
Please take a look...maybe you know the solution.
At the bottom you will find my question.
I work with Matlab 6 so I specify the path before I run the program.
% Calcualtion
% Name of files to "load"
praefix = ['STC'];
suffix = ['.txt'];
% Number of files
Start = 0;
End = 5;
counter = 1;
for i = Start:End
istr = num2str(i);
if i < 10
NameAlmost = [praefix,'00',istr,suffix];
elseif i > 99
NameAlmost = [praefix,istr,suffix];
else
NameAlmost = [praefix,'0',istr,suffix];
end
NameFinal = char(NameAlmost);
% Open files
Matrix = dlmread(NameFinal,',',5,0);
% Defining x and y
x(1:length(Matrix),counter) = 10^6.*Matrix
,1);
y(1:length(Matrix),counter) = 24.*Matrix
,2);
plot(x(1:length(Matrix),1),y(1:length(Matrix),counter))
hold on
counter = counter + 1;
end
Question: When I run this program Matlab plots all lines in one color
blue(!). Why?
What do I have to do so that I get different colors with a correct number of sources in the legend?
'cause I've already modified lots of things but when I got different colors in the plot the source data files in the legend (edit-show legend) missmatch with the lines drawn.
Please help me...I'm looking for the solution for ages.
Bye
I've coded a few lines and I have some problems.
Please take a look...maybe you know the solution.
At the bottom you will find my question.
I work with Matlab 6 so I specify the path before I run the program.
% Calcualtion
% Name of files to "load"
praefix = ['STC'];
suffix = ['.txt'];
% Number of files
Start = 0;
End = 5;
counter = 1;
for i = Start:End
istr = num2str(i);
if i < 10
NameAlmost = [praefix,'00',istr,suffix];
elseif i > 99
NameAlmost = [praefix,istr,suffix];
else
NameAlmost = [praefix,'0',istr,suffix];
end
NameFinal = char(NameAlmost);
% Open files
Matrix = dlmread(NameFinal,',',5,0);
% Defining x and y
x(1:length(Matrix),counter) = 10^6.*Matrix
y(1:length(Matrix),counter) = 24.*Matrix
plot(x(1:length(Matrix),1),y(1:length(Matrix),counter))
hold on
counter = counter + 1;
end
Question: When I run this program Matlab plots all lines in one color
blue(!). Why?
What do I have to do so that I get different colors with a correct number of sources in the legend?
'cause I've already modified lots of things but when I got different colors in the plot the source data files in the legend (edit-show legend) missmatch with the lines drawn.
Please help me...I'm looking for the solution for ages.
Bye