Any way to accomplish i++ in matlab?

后端 未结 2 663
礼貌的吻别
礼貌的吻别 2020-12-19 11:11

Assuming that srcHoughMatrix is a 3-dimensional matrix :

Instead of

    if (currentRadius >= MINIMUM_ALLOWED_RADIUS )
    % we\'re          


        
2条回答
  •  醉话见心
    2020-12-19 11:50

    Matlab doesn't have the ++ operator.

    However, if you would like to shorten your statement and avoid the temporary variable, you can at least write

    srcHoughMatrix(index,jindex,MINIMUM_ALLOWED_RADIUS:end) = ... 
        srcHoughMatrix(index,jindex,MINIMUM_ALLOWED_RADIUS:end) + 1;
    

    (assuming that currentRadius takes on all values from 1 through the 3rd-dimension-size of the array).

提交回复
热议问题