Error and unrecognized funcion
1 view (last 30 days)
Show older comments
Hola buenas, tengo un problema con el codigo de matlab, me pide que reproduzcan el inicio de una cancion con el siguiente codigo:
T=2;
Fs=4800;
t=0:1/Fs:T;
trompeta =envolvente(2,1,0.05,0.15,0.3,0.3,Fs);
do=nota(261,0.8,0.1,Fs)*trompeta;
re=nota(293,0.8,0.1,Fs)*trompeta;
mi=nota(329,0.8,0.1,Fs)*trompeta;
fa=nota(349,0.8,0.1,Fs)*trompeta;
sol=nota(392,0.8,0.1,Fs)*trompeta;
la=nota(440,0.8,0.1,Fs)*trompeta;
si=nota(493,0.8,0.1,Fs)*trompeta;
Melodia= [la,do,re,fa,sol,do,mi,mi,mi,la,re la];
sound(Melodia,Fs);
pero me sale el error de :
Unrecognized function or variable 'envolvente'.
no entiendo por que? El ejemplar me indica que el codigo que tengo que utilizar es envolvente. tengo que definir primero "envolvente" en otro fichero, o me hace falta un toolbox.
0 Comments
Accepted Answer
Rahul
on 1 Mar 2023
Edited: Rahul
on 5 Mar 2023
Hi Kaze,
This reply is in English to give you the fastest possible response.
I understand that you are receiving an error in "envelope" (Introduced in MATLAB R2015b). This function is present in Signal Processing Toolbox. If you are receiving an error Unrecognized function or variable 'envelope', it could be that Signal Processing Toolbox is not present in your MATLAB version. To check, you can execute following command in your command window:
a. for MATLAB versions R2012b and later:
>> ver -support
b. for MATLAB versions R2012a and earlier:
>> ver
If the toolbox is not present, you may need to purchase it. If it is available, you can check the availability of the in-built function "envelope" by executing the following commands in command window:
>> exist envelope % outputs 2 if the function is present else 0.
>> which -all envelope % outputs the directory path if the function is present.
Another possible issue could be that you have flagged the issue of function/variable shadowing i.e. using the variable/function name same as MATLAB in-built function name. Also, I suggest you to explore the documentation page of "envelope" to use it correctly in your code.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!