Borrar filtros
Borrar filtros

Why I can't run this coding?

1 visualización (últimos 30 días)
Syazana
Syazana el 25 de Oct. de 2022
Editada: VBBV el 25 de Oct. de 2022
syms q1 t
%q1(t)
h=q1
q1_of_t=sym('q1(t)')
h1=subs(h,q1,q1_of_t)
%diff q1(t),diff twice q1(t)
diff_q1t=diff(h1,t);
diff_q1t2=diff(diff_q1t,t);
% t is for time
% q1_of_t=sym('q1(t)') - can't run in Matlab online but actually 3 years
% ago its can run in dowloaded matlab

Respuesta aceptada

VBBV
VBBV el 25 de Oct. de 2022
syms q1(t) t
%q1(t)
h=q1
h(t) = 
q1_of_t=symfun('q1(t)',t)
q1_of_t(t) = 
h1=subs(h,q1,q1_of_t)
h1(t) = 
%diff q1(t),diff twice q1(t)
diff_q1t=diff(h1,t);
diff_q1t2=diff(diff_q1t,t)
diff_q1t2(t) = 
% t is for time
% q1_of_t=sym('q1(t)') - can't run in Matlab online but actually 3 years
% ago its can run in dowloaded matlab
  1 comentario
VBBV
VBBV el 25 de Oct. de 2022
Editada: VBBV el 25 de Oct. de 2022
use symfun
q1_of_t=symfun('q1(t)',t)
instead of
q1_of_t=sym('q1(t)')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Embedded Coder en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by