plotting a graph for cell
이전 댓글 표시
i have a cell array. it has a 12 rows and 1 column. i want to plot the graph for each cell element in the same graph. each cell element should differ in appearance. like circles, triangles and so on.
댓글 수: 2
Guillaume
2018년 12월 10일
What's in each cell of the cell array (size and type)?
What does the graph refers to? Matlab has many graph plotting functions from simple line graphs to bar, chart, etc. graphs.
johnson saldanha
2018년 12월 10일
채택된 답변
추가 답변 (1개)
Guillaume
2018년 12월 10일
The simplest way to plot each vector:
figure;
hold on;
hlines = cellfun(@plot, yourcellarray);
This will plot each vector in a different colour (according to the colourorder property of the figure). Matlab does not have an automatic way to cycle between different markers but you can change them afterward:
markers = {'o', '+', '*', '.', 'x', 's', 'd', '^', 'v', '>', '<', 'p'}; %12 different markers
[hlines.Marker] = markers{:};
댓글 수: 3
johnson saldanha
2018년 12월 10일
Guillaume
2018년 12월 10일
The lines
markers = {'o', '+', '*', '.', 'x', 's', 'd', '^', 'v', '>', '<', 'p'}; %12 different markers
[hlines.Marker] = markers{:};
will definitively change the markers of the 12 lines to 12 different markers.
johnson saldanha
2018년 12월 11일
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!