Showing the intersection points

2 ビュー (過去 30 日間)
TS Low
TS Low 2017 年 11 月 12 日
コメント済み: TS Low 2017 年 11 月 13 日
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 日
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 件のコメント
Jan
Jan 2017 年 11 月 13 日
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 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by