How to determine if elements in a column are negative

조회 수: 4 (최근 30일)
Dave
Dave 2013년 3월 22일
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
vipul utsav
vipul utsav 2013년 3월 22일
what is size of matrix?
Dave
Dave 2013년 3월 22일
It can vary, but the one I am currently using is 12x12 (doesn't have to be square)

댓글을 달려면 로그인하십시오.

채택된 답변

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
  댓글 수: 2
Dave
Dave 2013년 3월 22일
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

댓글을 달려면 로그인하십시오.

추가 답변 (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