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

조회 수: 121 (최근 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 CenterFile Exchange에서 Legend에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by