plot of theta_new and cos theta

조회 수: 2 (최근 30일)
Offroad Jeep
Offroad Jeep 2016년 1월 30일
답변: Walter Roberson 2016년 1월 30일
clc
clear
format compact
nmc = 1000
theta_initial = 0
% b = ones(2)
for i = 1:nmc
a = round (rand(1)-0.3)
theta_new = a + theta_initial
if theta_new(1,1) > theta_initial(1,1)
theta_initial = theta_new
plot(theta_new,cos(theta_new),'*')
if theta_initial >= 90
break
end
end
end
plot(theta_new,cos(theta_new),'*')
how i can correct for plotting theta_new and its cos(theta_new)

채택된 답변

Walter Roberson
Walter Roberson 2016년 1월 30일
After the first
plot(theta_new,cos(theta_new),'*')
add
hold on
and remove the second plot() call.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by