How to apply function in vector form variable?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi guys, I want to modify below codes.
In respect to every value of T, I want to apply below logic. T is N by 1 matrix. (ex: T = [ -1 2 0 1 0 3 -3 5 ... 0 ]' )
function f1 = function_1(T)
if T <= 0
function_1 = T*T ;
elseif ( 0< T ) && ( 1 <T)
function_1 = T + 2 ;
else (T >= 1)
function_2 = T + 3 ;
The thing is that if I run that code, conditional statement does not work. How can I modify it?
Thanks in advance:D
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!