필터 지우기
필터 지우기

How to graph structures 2

조회 수: 1 (최근 30일)
Karl
Karl 2013년 6월 2일
I asked the following question here http://www.mathworks.se/matlabcentral/answers/77360-how-to-graph-structures, but the proposed answer didn't work.
I have just learned how to make structure variables. I have problems making graphs with these. The commands below makes 6 different figures, one per "Aar", with only one line per figure. Each figure shows the values for one "Aar"-variable and "Alder" is on the x-axis. I wish to switch x -axis and lines, so that a line shows "Alder" and the x-axis show "Aar". Also I want to have only 1 figure, with all the "alder"-lines. Summed up: I want one figure with "Aar" on x-axis and one line per "Alder".
The structure variable gjG(x).Data, 1<=x<=8, consists of 6 11x8 matrices. As you can see of my comands, I only wish to draw data from the 11th row. I hope someone can help me with this!
Alder = {'<20', '2029','3039','4049','5059','6069','>70', 'all'};
Aar = {'2011', '2012', '2013_1', '2014_1', '2014_s2', '2014_s5'};
nAar = length(Aar);
nAlder = length(Alder);
numberOfColors = nAlder;
myColorMap = lines(numberOfColors);
for iAar = 1:nAar;
figure;
hold on
for iAlder = 1:nAlder
plot(gjG(iAar).Data(11,:), 'color', myColorMap((iAlder), :));
legend((Alder),'location','NE','FontSize',10);
end
hold off
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by