Help! Drawing markers in a circle in specific location

조회 수: 1 (최근 30일)
Rebecca Park
Rebecca Park 2016년 11월 9일
답변: KSSV 2016년 11월 9일
I'm really new to MatLab and I've been given this code but my Lecturer didn't explain it at all!
cL=-5:2*pi/8:9; c=-20:2*pi/8:9; R=20; x1=[R*cos(c') R*sin(c')]; xL=[R*cos(cL') R*sin(cL')];
plot(x1(:,2),x1(:,1),'ko','MarkerSize',30)
I want to be able to move the markers so they stay in the circle formation but are placed on the left or right but I can't figure out how to do that at all!
Any help? Or just a walk through of what each bit means.
Thank you,
Becky

답변 (1개)

KSSV
KSSV 2016년 11월 9일
clc; clear all ;
cL=-5:2*pi/8:9;
% c=-20:2*pi/8:9;
c = linspace(0,2*pi) ;
R=20;
x1=[R*cos(c') R*sin(c')];
xL=[R*cos(cL') R*sin(cL')];
plot(x1(:,1),x1(:,2),'r')
hold on
plot(xL(:,2),xL(:,1),'ko','MarkerSize',30)
axis equal

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by