Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Why won't this code generate the graph I need? What am I missing?
조회 수: 1 (최근 30일)
이전 댓글 표시
Create a vector t of elements with values from 0 to 360 with a spacing of 3.6 degrees. Using the parametric equations, create two vectors x and y that contain x coordinates and y coordinates, respectively.
function generateflower
for t=0:3.6:360
x = ((1 + cosd(5*t))*cosd(t));
y = ((1 + cosd(5*t))*sind(t));
plot(x,y)
end
end
댓글 수: 0
답변 (1개)
Walter Roberson
2017년 11월 3일
You are not following the instructions to "create two vectors x and y that contain x coordinates and y coordinates,"
When plot() is asked to plot a single point at a time, there is no line to generate. It only generates a mark if you configure a marker. For example you would have seen something if you had used
plot(x, y, '*')
hold on
댓글 수: 2
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!