フィルターのクリア

function that outputs a matrix with matrix elements referenced explicitly

2 ビュー (過去 30 日間)
Viesturs Veckalns
Viesturs Veckalns 2017 年 10 月 17 日
回答済み: Rik 2017 年 10 月 17 日
I can write a function that outputs a matrix
function f = func(arg)
...
f = [res1, res2, res3]
end
I can store the result of the function func in the following way
p = func(arg)
where p is a 1x3 matrix.
But I would like to explicitly reference the matrix elements, e.g.
[temp, elevation, sec] = func(arg)
An analogous example is the size function:
[nrow, ncol] = size(matrix)
What modifications to the function func are necessary?

採用された回答

Rik
Rik 2017 年 10 月 17 日
function [temp, elevation, sec] = func(arg)
...
end
You may also want to have a look at varargin, varargout, nargin and nargout.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by