Adding header - Function with two outputs and two frequencies.

2 vues (au cours des 30 derniers jours)
Anonym
Anonym le 13 Oct 2020
Commenté : Star Strider le 13 Oct 2020
I'm in the progress of adding a header with function to my program. It's this: https://se.mathworks.com/help/matlab/ref/function.html#btexd6d-4
The problem is that, I've two frequencies, and I actually don't know what to do, I've tried to use two functions, but it gives me an error.
I've tried the following, but it gives me an error:
function s1 = ToneOut_1(freq1,duration,amp);
function s2 = ToneOut_2(freq2,duration,amp);

Réponses (1)

Star Strider
Star Strider le 13 Oct 2020
Even after reading your other post, I am still not certain what a ‘header function’ is.
Perhaps an anonymous function will do what you want. See the documentation section on Anonymous Functions for a description and details.
  2 commentaires
Anonym
Anonym le 13 Oct 2020
Thanks alot, will look at that :)
Star Strider
Star Strider le 13 Oct 2020
My pleasure!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by