How to determine if elements in a column are negative

10 次查看(过去 30 天)
I am developing a program for a class project to determine the states for a petri net. It will use the basic algorithm for a coverability tree. One of the first steps is determining the firability of a transition, and I would need to determine if any of the elements in a column of a matrix is negative. I looked through the function list and didn't see anything that would apply.
Any suggestions for either the column logic or petri net in general would be appreciated.
Thanks

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-3-22
编辑:Azzi Abdelmalek 2013-3-22
any(A(:,3)<0) % find if any of column 3 of matrix A is negative

更多回答(1 个)

vipul utsav
vipul utsav 2013-3-22
[ind1 ind2]=find(matrix<0); matrixneg=matrix(ind1,ind2);

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by