How can I plot?

7 ビュー (過去 30 日間)
hem
hem 2023 年 11 月 19 日
編集済み: hem 2023 年 11 月 20 日
clear, close all
syms b omega r t theta T delta
b = 0.1; omega = 2*pi/5;
r = b*(1+omega*t); theta = omega*t;
C = [r*cos(theta); r*sin(theta)];
C_diff = diff(C, t);
v = norm(C_diff);
T = 2*pi/omega; 2*pi == omega*T;
delta = 2*pi*b;
tHAT = 1/v*C_diff;
figure()
fplot(r*cos(theta), r*sin(theta), [0 10*pi], 'LineWidth', 1.2)
hold on;
hold off;
axis equal, grid on, box on
xlabel('x'), ylabel('y')
-----------------------
this is my practice code. what should I do to plot tHAT? I need your help.

採用された回答

Torsten
Torsten 2023 年 11 月 19 日
syms b omega r t theta T delta
b = 0.1; omega = 2*pi/5;
r = b*(1+omega*t); theta = omega*t;
C = [r*cos(theta); r*sin(theta)];
C_diff = diff(C, t);
v = norm(C_diff);
T = 2*pi/omega; 2*pi == omega*T;
delta = 2*pi*b;
tHAT = 1/v*C_diff;
figure()
fplot(r*cos(theta), r*sin(theta), [0 10*pi], 'LineWidth', 1.2)
hold on;
%hold off;
axis equal, grid on, box on
xlabel('x'), ylabel('y')
title('< Archimedes spiral >', 'fontsize', 12)
for i = 1:7
v1 = subs(C_diff,t,5*(i-1));
v1 = v1/norm(v1);
p1 = subs(C,t,5*(i-1));
p2 = p1 + v1;
plot([p1(1),p2(1)],[p1(2),p2(2)],'r');
end
hold off

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by