필터 지우기
필터 지우기

How does matlab go about drawing an image like the one below?

조회 수: 4 (최근 30일)
ma Jack
ma Jack 2022년 7월 8일
편집: Chunru 2022년 7월 8일
Hi all,
I recently wanted to draw a graphic (below, this is a simple example I drew using PPT):
It consists of a black dot and two red arrows.
I now have a set of data about the position of the black points and the red vector (with each black point as the coordinate origin), how do I plot an image like the one above using matlab? Does anyone have any suggestions? Thanks in advance.
Additions:
The data is in the form of a black point at [xx,yy] and a red vector (arrow) at [a,b] (starting at the black point where the red arrow is).

채택된 답변

Chunru
Chunru 2022년 7월 8일
편집: Chunru 2022년 7월 8일
% x y ux1 uy1 ux2 uy2
data = [1 2 0.1 -0.3 1 1;
5 3 1 2 -1 -1
2 5 -1 -2 -0.5 0] ;
figure; hold on;
s = 0.3; % control the length of arrow
quiver(data(:,1), data(:,2), data(:,3), data(:,4), s, 'r-');
quiver(data(:,1), data(:,2), data(:,5), data(:,6), s, 'r-');
plot(data(:,1), data(:,2), 'bo', 'MarkerFaceColor', 'b');
axis equal

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by