how to imput a matrix end outpur four arguments
조회 수: 2 (최근 30일)
이전 댓글 표시
How can i create a function that has an imput a matrix arguments and in outputs four arguments, the corner's matrix
댓글 수: 0
답변 (1개)
Thiago Henrique Gomes Lobato
2020년 5월 3일
The main function creation in matlab has the following form:
function output = FuncName(input)
output = f(input)
end
Input can be a matrix, and, in your case, the function is to get the corners, which can be done with simple index. So:
function output = FuncName(input)
%Up-Left %Up-right %Bottom-left %Bottom-right
output = [input(1,1), input(1, end); input(end, 1),input(end,end) ];
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!