How can I specify a summation constraint?
Ältere Kommentare anzeigen
Hi, I have this matrix
P =
[ 0, 1/5, p13, p14, p15]
[ 0, 0, p23, p24, p25]
[ 0, 0, 0, p34, p35]
[ 0, 0, 0, 0, p45]
[ 0, 0, 0, 0, 0]
These are the probabilities and I've defined them as symbolic variables. I want to give a constraint that says that the sum of each row is equal to 1. Can someone direct me on how I can get started or what I need to look at?
Thanks,
Burak
Antworten (1)
Azzi Abdelmalek
am 12 Apr. 2016
0 Stimmen
syms p13 p14 p15 p23 p24 p25 p34 p35 p45 P =[ 0, 1/5, p13, p14, p15 0, 0, p23, p24, p25 0, 0, 0, p34, p35 0, 0, 0, 0, p45 0, 0, 0, 0, 0]
isequal(sum(P,2),ones(size(P,1),1))
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!