Plotting Graphs using Matlab
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hi. I need to plot a specific type of graph using Matlab but I can't find a command to do it. If anyone can tell me what command plots graphs like this it'll be very helpful This is what the graph is supposed to look like

채택된 답변
the cyclist
2015년 8월 28일
0 개 추천
댓글 수: 7
farheen asdf
2015년 8월 28일
I have already used almost all of these plots but couldn't find anything of much help yet.
the cyclist
2015년 8월 28일
farheen asdf
2015년 8월 28일
편집: the cyclist
2015년 8월 28일
I think the problem might be in my equations for x and y coordinates. I'm using the equations:
x=l1*cos(theta1)+l2*cos(theta1+theta2)
y=l1*sin(theta1)+l2*sin(theta1+theta2)
where,
l1=10;
l2=7;
0<theta1<pi/2;
0<theta2<pi
I think I haven't correctly initiated angles theta1 and theta2 this is the code i have written
theta1=0:0.01:pi/2;
theta2=0:0.02:pi;
does this give the same range as 0<theta1<pi/2? I have used the gap between the two points in theta1 and theta2 as 0.01 and 0.02 because the x-y equations require them to be of the same size.
farheen asdf
2015년 8월 28일
this is what i have managed to get so far. It's almost the same but not completely. Any suggestions?

the cyclist
2015년 8월 28일
편집: the cyclist
2015년 8월 28일
Try this:
l1=10;
l2=7;
theta1=0:0.01:pi/2;
theta2=0:0.02:pi;
[tt1,tt2] = meshgrid(theta1,theta2);
x = l1*cos(tt1)+l2*cos(tt1+tt2);
y = l1*sin(tt1)+l2*sin(tt1+tt2);
figure
plot(x,y,'r.')
The problem was that you were not actually using all the possible pairings of (theta1,theta2).
farheen asdf
2015년 8월 28일
thank you so much this is exactly what i needed :)
Happy to help. Note that in your version, you were forced to keep the number of points in the theta1 and theta2 vectors the same. You don't need to do that now, because you never actually add those two vectors to each other. That will give you more flexibility in making the figure more visually appealing (or more accurately mimic the exact figure you wanted). For example, you can do something like
theta1=0:0.05:pi/2;
theta2=0:0.05:pi;
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
