Borrar filtros
Borrar filtros

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

18 visualizaciones (últimos 30 días)
Nasir Abdullahi
Nasir Abdullahi el 5 de Jul. de 2023
Comentada: Nasir Abdullahi el 5 de Jul. de 2023
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.

Respuestas (1)

Abhas
Abhas el 5 de Jul. de 2023
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!

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by