Array as an input

2 次查看(过去 30 天)
amateurintraining
amateurintraining 2017-9-24
I have an input A into a function and I want to define the function as a 3-by-4 matrix. How do I write the input?

回答(1 个)

the cyclist
the cyclist 2017-9-24
Define the function like this
function [out_stuff] = fa(in_stuff)
out_stuff = 2*in_stuff; % Or whatever
end
Call it like this:
A = rand(3,4);
outA = fa(A);

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by