MATLAB GUI calling external function
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hey,
For my senior project my task was to create a program that takes in user voice, and recognizes the frequency and returns the fundemental frequency of the voice. I have that task completed, but I wanted to implement that into a matlab GUI. I'm having trouble getting the GUI to read the external function. The external function that does the analysis originally took in user input to specify things such as recording length, and whether to return the exact pitch or the closest musical note ("corrected"). thanks for your help!
1 Kommentar
Antworten (1)
Geoff Hayes
am 12 Mai 2022
@Jason Chang - you will need to change the signature for your appsynthesizertestcode function so that you can pass in the parameters that you had been requesting before (via @doc:input). So perhaps something like
function appsynthesizertestcode(mode, recording_type, rec_length)
And you would call this function from your app as
% Value changed function: StartButton
function StartButtonValueChanged(app, event)
appsynthesizertestcode(app.ModeDropDown.Value, app.TypeDropDown.Value, app.recordlength.Value);
end
Note that the above will pass in strings for the mode and recording_type. Your appsynthesizertestcode function expects these to be integers so you will need to convert them from the string to the integer either before you pass them to the function or from within the function itself.
Also, you can remove calls to the app from within your function since it won't know about the app (unless you pass it in as a parameter).
0 Kommentare
Siehe auch
Kategorien
Mehr zu Variables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!