How to determine if elements in a column are negative

5 vues (au cours des 30 derniers jours)
Dave
Dave le 22 Mar 2013
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
  2 commentaires
vipul utsav
vipul utsav le 22 Mar 2013
what is size of matrix?
Dave
Dave le 22 Mar 2013
It can vary, but the one I am currently using is 12x12 (doesn't have to be square)

Connectez-vous pour commenter.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 22 Mar 2013
Modifié(e) : Azzi Abdelmalek le 22 Mar 2013
any(A(:,3)<0) % find if any of column 3 of matrix A is negative
  2 commentaires
Dave
Dave le 22 Mar 2013
Thanks, where can I find some of this information? I would like to be able to find it myself if possible. Thanks again for your time & help

Connectez-vous pour commenter.

Plus de réponses (1)

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

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by