How to plot the content of a Structure without using a for loop?
조회 수: 2 (최근 30일)
이전 댓글 표시
I need to plot the content of a structure fiel:
Each row in the column Position is made by 2 elements (x and y). I need to plot all the rows at once on a scatter plot.
Using:
pop(1).Position(1)
I can access the first value of the first row/column. But I would like to plot all the column values without using a for loop.
Is that possible?
Thanks in advance!
댓글 수: 0
채택된 답변
Ahmet Cecen
2018년 4월 6일
편집: Ahmet Cecen
2018년 4월 6일
Yes, in a way that is not apparent at first look, but very simple when you think about it:
[pop.Position]
I believe you can figure out the rest after this critical piece of information.
댓글 수: 3
Ahmet Cecen
2018년 4월 6일
편집: Ahmet Cecen
2018년 4월 6일
Its just:
[pop.Position]
Do that and check the answer. A simple reshape will solve your problem after that.
Edit: Fixed Braces.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!