Hello MATLAB Community, again.
So I have a code where it speaks and shows the time, but I really want my code to speak the time I enter.
Right now I have:
res=input('','s'); if strcmpi(res,'What is the time') NET.addAssembly('System.Speech'); obj = System.Speech.Synthesis.SpeechSynthesizer; obj.Volume = 100; Speak(obj, 'this is the time' ) fprintf('%s\n', datestr(now,'HH:MM:SS')) s=-1; k=1; end
It speaks out but tells the current time. Is there a way to make it speak the time a user enters? Please provide an example. Thank you.
Best Answer