How do string with quotes
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, I wanted to ask two questions when creating a character string to process a function in matlab. I want to do the following (which is to extract an audio wav youtube URL); where I created and saved in the directory wav youtube with the id of the shape e4d0LOuP4Uw.wav
system ( 'youtube-dl -x --audio-format wav --id https://www.youtube.com/watch?v=e4d0LOuP4Uw');
Well but that string the address is an input parameter that reads the URL of youtube after performing the above command is:
youtube_id = https: //www.youtube.com/watch?v = e4d0LOuP4Uw
then I want you, I read that parameter youtube_id but in quotation marks and do not know how to do ...
system ( "sudo youtube-dl -x --audio-format wav --id 'youtube_id);
How do I enter the input parameter enters quotes?
The second question is, how can I upload or just call that file is saved me or I believe in the working directory or folder e4d0L0uP4Uw.wav for use later in the function?
Thanks in advanced!
3 Commenti
Risposte (1)
Image Analyst
il 22 Mag 2016
Perhaps this will help:
stringWithDoubleQuote = 'abc"def'
stringWithSingleQuote = 'abc''def'
singleQuote = 39; % ASCII for single quote
stringWithSingleQuote = sprintf('abc%cdef', singleQuote)
In command window:
stringWithDoubleQuote =
abc"def
stringWithSingleQuote =
abc'def
stringWithSingleQuote =
abc'def
3 Commenti
Image Analyst
il 23 Mag 2016
You can do this:
command = sprintf('youtube-dl -x YouTube- --audio -format --id "%s"', youtube_url);
This makes up the command line string with the URL you passed in enclosed in double quotes, which is how I think the system() command wants it.
Vedere anche
Categorie
Scopri di più su Audio and Video Data in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!