why won't Matlab plot anything?

2 次查看(过去 30 天)
thetaP=linspace(0, 2*pi);
plot(R1*cos(thetaP), R1*sin(thetaP), '-b', ...
R2*cos(thetaP), R2*sin(thetaP), '-r')
when R1 and R2 are defined

回答(1 个)

Kojiro Saito
Kojiro Saito 2023-6-13
Your code works fine.
R1=5;
R2=7;
thetaP=linspace(0, 2*pi);
plot(R1*cos(thetaP), R1*sin(thetaP), '-b', ...
R2*cos(thetaP), R2*sin(thetaP), '-r')
Possibly, figure is being off. Please try adding figure before plot.
figure;
plot(R1*cos(thetaP), R1*sin(thetaP), '-b', ...
R2*cos(thetaP), R2*sin(thetaP), '-r')

类别

Help CenterFile Exchange 中查找有关 Graphics Objects 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by