Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Writing function that ether gives as a result or that uses a two-dimensional array as input?

1 vue (au cours des 30 derniers jours)
David
David le 19 Déc 2014
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hello.
I have been trying for hours to get a function to work as for example
function [data] = failure(value, somethingElse)
where data is a 2x2048 double array, or value being a 2x2048 double array. I don't need both to be 2x2048 but I fail to make any function using such a variable, does any one know how a function using that kind of variables would look like?
Regards
  1 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 19 Déc 2014
Modifié(e) : Azzi Abdelmalek le 19 Déc 2014
This is not clear. We don't know what your function has to do

Réponses (1)

Thorsten
Thorsten le 19 Déc 2014
Modifié(e) : Thorsten le 19 Déc 2014
It is very easy to use arrays in Matlab. Just open a new file "myfun.m", define a function
function y = myfun(x)
y = 2*y;
save the file and call it from the command line or from some other function. e.g.,
R = ones(2, 2048);
R2 = myfun(R);

Cette question est clôturée.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by