HELP with for loop plots and changing symbol styles
이전 댓글 표시
Hi all, I am trying to generate a plot that looks like the attachment (that I generated without using for loops), using the code pasted below. However there seems to be an error somewhere as all of my symbols are coming out as black dots (not coloured black, red, and blue). This is my first time trying to use for loops to create figures, so the issue is likey in my loops. Can anyone see a mistake? I've attached the data file in case anyone wants to try to run it.
% code
load('trilobite_a.mat')
% plot original data
[N,M]=size(X);
figure;
hold on
col={'ro', 'r*', 'rd', 'bo', 'b*', 'bd', 'ko', 'k*', 'kd'};
for ii = 1:N;
hold on
for k=1:length(col);
plot(X(ii,:), col{k});
end
end
hold off
legend('A1','A2','A3','D1','D2','D3','P1','P2','P3');
xlabel('Variable');
ylabel('Trilobite Measurements');
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!