flow control with functions of matrices
조회 수: 1 (최근 30일)
이전 댓글 표시
theta is a matrix [0:0.01:0.5]*pi
I want to evaluate a function t using a flow control of values of theta:
if theta>pi*(1/2 - 0.01)
t=Inf
else
t = tan(theta)
end
How to achieve such a flow control when theta is a matrix? t is assumed to be a matrix with the same dimensions as theta.
댓글 수: 0
채택된 답변
Walter Roberson
2017년 10월 16일
t = inf(size(theta));
mask theta <= pi*(1/2 - 0.01);
t(mask) = tan(theta(mask));
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!