필터 지우기
필터 지우기

Plotting very specific locations in matrix

조회 수: 1 (최근 30일)
Chris Matthews
Chris Matthews 2017년 4월 25일
답변: KSSV 2017년 4월 25일
Hi all, I want to plot a very specific group of values in a 6 x6 matrix on the same plot - the first 4 values in row 1, the first 3 values in row 2, the first value in row 3.
Can this be done? Thanks Christine

답변 (1개)

KSSV
KSSV 2017년 4월 25일
A = rand(6,6) ;
[nx,ny] = size(A) ;
x = 1:nx ;
y = 1:ny ;
[X,Y] = meshgrid(x,y) ;
plot3(X,Y,A,'.r') ;
hold on
plot3(X(1,1:4),Y(1,1:4),A(1,1:4),'Ob')
plot3(X(2,1:3),Y(2,1:3),A(2,1:3),'Og')
plot3(X(3,1),Y(3,1),A(3,1),'Om')
view(2)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by