MATLAB graph editing in the figure window

조회 수: 6 (최근 30일)
Leon Phung
Leon Phung 2018년 9월 26일
댓글: Leon Phung 2018년 9월 26일
A professor of mine wants the class to turn the homework that has a graph. The guy shows the class how to do once last month and refuses to repeat it. He wants the graph with a thickness of 3, a white circle at the root (where Y=0) as I recall he draw a circle then scale down, and an arrow pointing at the root (along with its name).
The first picture is my graph, the second picture is what it supposed to look like(format).

채택된 답변

Bish Erbas
Bish Erbas 2018년 9월 26일
편집: Bish Erbas 2018년 9월 26일
Try this (I am leaving some details for you to discover like text on graph and axes labels):
% Definition
x = 0:0.1:10;
f = @(x) (x.*cos(x)+1);
% Find roots
r1 = fzero(f,2);
r2 = fzero(f,4);
r3 = fzero(f,8);
% Plot
plot(x,f(x),'LineWidth',3);
grid on;
hold on;
scatter([r1 r2 r3],[f(r1) f(r2) f(r3)],150,'MarkerEdgeColor',[0 0 0],'MarkerFaceColor',[1 1 1],'LineWidth',1);
hold off;
  댓글 수: 3
Leon Phung
Leon Phung 2018년 9월 26일
got it, thank you! :)

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by