Extracting symbolic values from symbolic matrix

조회 수: 8 (최근 30일)
Mustafa Duran
Mustafa Duran 2023년 1월 11일
답변: Torsten 2023년 1월 12일
I have a long code which has syms like q1(t) q2(t) ...
I have a 3x1 matrix which is in format like: n1=a1*q3(t)
a2*sin(q2(t)
0
How can i call the second row? Because when i try to call it like n1(2,1), algorithm perceive it as i attend a value to t.

채택된 답변

Torsten
Torsten 2023년 1월 12일
syms t q2(t) q3(t) a1 a2
n1 = [a1*q3(t);a2*sin(q2(t));0];
n1(2,1) % extract element (2,1)
ans = 
n1(2,:) % extract complete 2nd row
ans = 

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by