how to imput a matrix end outpur four arguments
1 次查看(过去 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!