Why wont all 4 subplots not work?

조회 수: 1 (최근 30일)
Collin Kerr
Collin Kerr 2016년 4월 7일
댓글: Collin Kerr 2016년 4월 7일
subplot(2,2,1)
fplot('cos(u-45)',[0 360])
subplot(2,2,2)
fplot('3*cos(2u)-2',[0 360])
subplot(2,2,3)
fplot('sin(3u)',[0 360])
subplot(2,2,4)
fplot('-2*cos(u)',[0 360])
%0 to 360 is degrees just an fyi
  댓글 수: 2
Muhammad Usman Saleem
Muhammad Usman Saleem 2016년 4월 7일
fyi?
Collin Kerr
Collin Kerr 2016년 4월 7일
Its just an abbreviation, just scratch its not important.

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2016년 4월 7일
Because "2u" is not correct MATLAB syntax for multiplication. You need "2*u".
This code runs:
u = 0:360;
subplot(2,2,1)
fplot('cos(u-45)',[0 360])
subplot(2,2,2)
fplot('3*cos(2*u)-2',[0 360])
subplot(2,2,3)
fplot('sin(3*u)',[0 360])
subplot(2,2,4)
fplot('-2*cos(u)',[0 360])

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by