Trouble passing a vector as the input for a function
이전 댓글 표시
I'm trying to take a vector as an input for a function and change all the negative values of the vector into 0's, then output the new vector.
function newX = valu(x)
for x
if (x<0)
x = x .* 2;
end
newX = x;
end
end
How would I tell Mathlab that X is a vector that will be assigned by the user (when calling the function)?
댓글 수: 2
madhan ravi
2018년 11월 2일
Please don’t close question which has answer.
Rena Berman
2018년 11월 7일
(Answers Dev) Restored edit
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!