how to create a variable without assigning a value to it and also the variables shouldnt be symbolic variables
조회 수: 20 (최근 30일)
이전 댓글 표시
bhanu kiran vandrangi
2021년 7월 25일
댓글: bhanu kiran vandrangi
2021년 7월 25일
syms e d
m= [27.5084 -10.7668 -9.7727;-20.6533 15.8060 14.8502];
k1=[27.5084*e -10.7668*e -9.7727*e;-20.6533*e 15.8060*e 14.8502*e];
g11=tf([27.5084],[1 0])
g12=tf([ -10.7668],[1 0])
g13=tf([-9.7727],[1 0])
g21=tf([ -20.6533],[1 0])
g22=tf([15.8060],[1 0])
g23=tf([14.8502],[1 0])
k2=[g11 g12 g13;g21 g22 g23]
k3=k2*d
i want the matrix k3 in terms of variable 'd' so i can optimize the matrix with respect to the variable 'd' but that is not happening as d is a sym variable
and also unable to perform any kind of command on k1 as it has sym variable , is there any way to rectify this
댓글 수: 0
채택된 답변
Walter Roberson
2021년 7월 25일
syms e d
m = [27.5084 -10.7668 -9.7727;-20.6533 15.8060 14.8502];
k1 = m * e; %not used
k2c = arrayfun(@(V) tf(V,[1 0]), m, 'uniform', false);
k2 = [k2c{1,:}; k2c{2,:}]
syms S
K2N = cellfun(@(V) poly2sym(V,S), k2.Num)
K2D = cellfun(@(V) poly2sym(V,S), k2.Den)
k3 = K2N./K2D * d
This is symbolic, so you can start manipulating it, and can start optimizing.
댓글 수: 3
Walter Roberson
2021년 7월 25일
syms e d
m = [27.5084 -10.7668 -9.7727;-20.6533 15.8060 14.8502];
k1 = m * e; %not used
k2c = arrayfun(@(V) tf(V,[1 0]), m, 'uniform', false);
k2 = [k2c{1,:}; k2c{2,:}]
syms S t
K2N = cellfun(@(V) poly2sym(V,S), k2.Num)
K2D = cellfun(@(V) poly2sym(V,S), k2.Den)
k3 = K2N./K2D * d
ik3 = ilaplace(k3, S, t)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!