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

Geoff Hayes
Geoff Hayes 2022년 4월 27일
@Monika Grezer - can you show all of the code for one of your push button callbacks? Also, please describe what A is, how many dimensions, what the line A = A/max(max(max(A))); is supposed to be doing.
Walter Roberson
Walter Roberson 2022년 4월 27일
Do you have a variable named max?
Jan
Jan 2022년 4월 27일
Sending code privately is not the nature of this forum. The idea is to provide help for free, if the solution is available for the community.
You cannot store 2 audio signals in a 2x2 matrix, because this matrix have 4 elements only. This would be an extremely short sound. The error message is possible only, if A has more than 3 dimensions. Check this again.
@Monika Grezer So why is A empty? When you initialize as
A = abs(randn(n, m));
what is m? Could it be that this variable is set to zero?
Walter Roberson
Walter Roberson 2022년 4월 28일
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.
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.)

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2022년 4월 27일

1 개 추천

A = A ./ max(A(:));
My guess at the moment is that your A is empty.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

질문:

2022년 4월 27일

편집:

DGM
2022년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by