Four element Array from workspace and plot it
이전 댓글 표시
I have a matrix a=[1 2 3 4] in my workspace, how can i plot it in the format a[x1 y1 x2 y2]. So that (x1y1) and (x1y2) forms a line.
채택된 답변
추가 답변 (1개)
Walter Roberson
2016년 1월 27일
x1 = a(1);
x2 = a(3);
y1 = a(2);
y2 = a(4);
plot([x1, x2], [y1, y2]);
This is not the best way, but you appear to be having difficulty with the better ways.
By the way, we are still waiting for you to post the additional information requested in your earlier question on this topic.
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!