Now I am plotting a graph of function by using
A = [1 9];
B = [1 9];
plot(A,B,'*')
axis([0 10 0 10])
hold on
line(A,B)
hold off
As the graph is shown below
Thus, the next step i need to get the points value that it pass along For this case it will be (2,2), (3,3), (4,4), ...etc
How do I write my next command to let the matlab showing the value of all intersection points (better if can decide how many points i need)

 채택된 답변

Jan
Jan 2017년 11월 12일
편집: Jan 2017년 11월 12일

0 개 추천

A = [1 9];
B = [1 9];
n = 10; % Number of intermediate points
AA = linspace(A(1), A(2), n);
BB = linspace(B(1), B(2), n);
plot(AA, BB, '-*')

댓글 수: 3

TS Low
TS Low 2017년 11월 12일
편집: TS Low 2017년 11월 12일
thx, but i would like to the points to show in text like
ans =
(2,2)
(3,3)
like this;
u have been show the points for me in graph but i need matlab shows it for me in digit
n = 10; % Number of intermediate points
AA = linspace(A(1), A(2), n);
BB = linspace(B(1), B(2), n);
P = [AA(2:end-1); BB(2:end-1)];
fprintf('(%g, %g)\n', P);
TS Low
TS Low 2017년 11월 13일
Excellent
It solve my problem
Great thx Bro

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2017년 11월 12일

댓글:

2017년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by