Write a function taking three variables as input and returning the minimum of them. i've tried doing this-
조회 수: 5 (최근 30일)
이전 댓글 표시
a = input ('enter a >');
b = input ('enter b >');
c = input ('enter c >');
A = [a, b, c];
B = min(A);
disp(B)
however this seems so simple is there any way you can create a user defined function in which you can input 3 values and receive the minimum as an output??
댓글 수: 0
답변 (1개)
Steven Lord
2021년 10월 25일
See this section of the documentation for instructions on how to create a function with input and output arguments in a file.
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!