How do I write an x with a dot over it on my graph legend?

116 ビュー (過去 30 日間)
Nasir Abdullahi
Nasir Abdullahi 2023 年 7 月 5 日
コメント済み: Nasir Abdullahi 2023 年 7 月 5 日
I have a simple problem. I want to use dot notation . like v =dx/dt but I use a dot notation so velocity will be an x with a dot over it like a hat. how do I accomplish that? I know there are certain markups I can use in the legend function likelegend('\delta x(t)) = Δx(t).
What code do I use to get this: ẋ ??
Please and thank you.

回答 (1 件)

Abhas
Abhas 2023 年 7 月 5 日
Hi Nasir,
You can set the dot over a variable on your graph as a legend using the following method:-
t = [0, 1, 2, 3, 4]; % Time values
x = [0, 2, 4, 6, 8]; % Position values
% Plot the data
plot(t, x)
% Set the labels
xlabel('Time')
ylabel('Position')
% Set the legend with dot notation
legend('$\dot{x}(t)$ = Velocity', 'Interpreter', 'latex')
Hope this helps!
  1 件のコメント
Nasir Abdullahi
Nasir Abdullahi 2023 年 7 月 5 日
Hi Abhas,
This fixed my formatting immediately.
Thank You so much! :)

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

カテゴリ

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

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by