How can I plot?

10 次查看(过去 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 CenterFile Exchange 中查找有关 2-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