create a function to...
이전 댓글 표시
Create a function *.m file that accepts a 2-dimensional array as a function input and has two function outputs. This function will use a nested loop to create one column vector that contains the sum of all the positive values in each row and another column vector that contains sum of all the negative numbers of each row. These two column vectors should be returned (sent back) to the function call.
댓글 수: 1
채택된 답변
추가 답변 (1개)
Matt J
2013년 11월 1일
Make "positive" and "negative" into vectors and index them appropriately, e.g.,
positive(k)=positive(k)+x(k,j)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!