フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Tengo 2 gráficas , en el eje Y tengo Aceleración en gráf. 1 y Velocidad en gráf. 2. Y en el eje X para ambas tengo Periodo (Segundos). ¿Como puedo crear una tercera gráfica?

1 回表示 (過去 30 日間)
Queren
Queren 2024 年 4 月 25 日
閉鎖済み: Dyuman Joshi 2024 年 4 月 25 日
La tercera grafica debe tener en Y el valor de la aceleración y en el eje X debe tener el valor de desplazamiento. Muchas gracias de antemano por su ayuda

回答 (1 件)

Lokesh
Lokesh 2024 年 4 月 25 日
Hi Queren,
It is my understanding that you want to plot acceleration vs displacement, given acceleration vs time and velocity vs time.
To plot acceleration versus displacement, you need to integrate the velocity data over time to calculate displacement. For discrete data, numerical integration, such as "cumtrapz" (Cumulative trapezoidal numerical integration), can be used for this purpose.
Below is a sample MATLAB code snippet demonstrating how to achieve this:
time = linspace(0, 10, 100); % 0 to 10 seconds
velocity = sin(time); % Example velocity data
acceleration = cos(time); % Example acceleration data
displacement = cumtrapz(time, velocity);%cumulative trapezoidal integration
figure;
plot(displacement, acceleration);
xlabel('Displacement');
ylabel('Acceleration');
title('Acceleration vs. Displacement');
grid on;
Refer to the following MATLAB documentation for more information on "cumtrapz":

この質問は閉じられています。

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by