how to create a variable without assigning a value to it and also the variables shouldnt be symbolic variables
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
bhanu kiran vandrangi
am 25 Jul. 2021
Kommentiert: bhanu kiran vandrangi
am 25 Jul. 2021
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 25 Jul. 2021
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 Kommentare
Walter Roberson
am 25 Jul. 2021
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)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!