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?

Respuestas (1)

the cyclist
the cyclist el 24 de Sept. de 2017

0 votos

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);

Categorías

Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Sept. de 2017

Respondida:

el 24 de Sept. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by