필터 지우기
필터 지우기

How to plot grid-position like figure in Matlab

조회 수: 1 (최근 30일)
Aftab Ahmed Khan
Aftab Ahmed Khan 2014년 5월 7일
편집: Star Strider 2014년 5월 7일
Hello Everyone, I want to plot/make a structure like this in Matlab. Can anyone help me with this ? P.S. I am very new to Matlab as well. Thank you.

채택된 답변

Star Strider
Star Strider 2014년 5월 7일
This works for the figure on the left:
xy = [1:14]*200;
[X, Y] = meshgrid(xy);
xyo = xy([4 11]);
figure(1)
plot(X, Y, '.k')
hold on
plot(X(:,[4 11]), Y(:,[4 11]), 'ok')
plot(X([4 11],:), Y([4 11],:), 'ok')
plot(X([4 11],[4 11]), Y([4 11],[4 11]), 'sr')
hold off
axis square
This will get you started. Make the necessary changes to get the one on the right. See the documentation for the legend function to get the legend textbox.
  댓글 수: 2
Aftab Ahmed Khan
Aftab Ahmed Khan 2014년 5월 7일
Thanks mate. I can play around with it now to get an idea. Take care.
Star Strider
Star Strider 2014년 5월 7일
편집: Star Strider 2014년 5월 7일
My pleasure!
Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by