Error with audio from pushbutton

7 views (last 30 days)
Monika Grezer
Monika Grezer on 27 Apr 2022
Edited: DGM on 20 Jun 2022
Hi! I am trying to make some pushbuttons in Matlab. When I press each pushbutton, I want that every one of them to play a sound. I have this error while pressing one of the buttons:
I get the same error for this line: x = A*s;. I am also plotting the graphs of each variable that I want to play as sound, and when I plot them, I don't get any error.
Could you please help me?
  6 Comments
Walter Roberson
Walter Roberson on 28 Apr 2022
push3 assumes that global variable A has been set, but your code here does not set it. Your first function builds and returns A, without storing it in the global A.
Walter Roberson
Walter Roberson on 29 Apr 2022
You have that function
semnaleamestecate
that returns A as its second output.
In the place that you call semnaleamestecate you should be writing to the global A there (or in some calling function that you return A to.)

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 27 Apr 2022
A = A ./ max(A(:));
My guess at the moment is that your A is empty.

More Answers (0)

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!