Move your legend command outside the loop ...
for i=1:length(fieldnames(Data));
plot(Data.(Name{i}),'Color',cmap(i,:));hold on
end
legend(Name);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!