Help with parametrizing a function and creating points

I don't understand how to do this:
"In MATLAB, call symbols corresponding to the x- and y- coordinates of P1 = (x1, y1) and P2 = (x2, y2). Define a symbolic function r(t) that parametrizes the line segment from P1 to P2"
I don't know how I would write this in matlab, I keep getting index errors when trying to write a function

1 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 12 月 6 日
Please show what you have written yet.

サインインしてコメントする。

 採用された回答

Matt J
Matt J 2023 年 12 月 6 日

0 投票

syms x y P [1,2]
syms r(t)
P1=[x1, y1];
P2=[x2, y2];
r(t)=P1+t*(P2-P1)
r(t) = 

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

質問済み:

Nic
2023 年 12 月 6 日

コメント済み:

2023 年 12 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by