这类似于我之前提出的关于在 Matlab 中打开 pdf 的问题。
file = 'sl3_knt_1_2.pdf'
location = 'C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe %s'
str = sprintf(location,file);
system(str)
这会返回警告:
Warning: Invalid escape sequence appears in format string. See help sprintf for valid escape sequences.
我认为它对作为转义序列读取的位置变量有所帮助,因为它使用\但我不确定。我似乎无法让它工作。
最佳答案
试试这个:
file = 'sl3_knt_1_2.pdf'
location = 'C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe'
str = sprintf('%s %s',location, file)
system(str)
关于matlab - 在 Matlab 中使用 sprintf?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12377708/