creating function that will accept input argument and return out argument
이전 댓글 표시
how to Create a function called square() which will accept one input argument and return the squared value of the input argument as an output argument (result)
답변 (2개)
Sulaymon Eshkabilov
2021년 6월 5일
function OUT = SQUARE(a)
OUT = a.^2;
end
댓글 수: 2
Walter Roberson
2021년 6월 5일
... it was a homework question (I have seen it before.)
On the other hand, it is such a simple homework question that it is difficult to resist just giving the solution.
Sulaymon Eshkabilov
2021년 6월 5일
@Walter: I will take a note on this issue. You are right on hw assignments. Thanks.
카테고리
도움말 센터 및 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!