unable to input using filename (dxf)

2 次查看(过去 30 天)
My code: % Reading the dxf-file.
filename = input('Type the name of the dxf-file:');
In command window I write
my_dxf_file.dxf
(saved in the same folder as the file) but get the response:
Error using input Undefined function or variable 'my_dxf_file'
Anyone know why?
Thanks

采纳的回答

Mischa Kim
Mischa Kim 2014-2-26
编辑:Mischa Kim 2014-2-26
Ellen, use
'my_dxf_file.dxf'
with the primes (to make it a string input).

更多回答(1 个)

Wayne King
Wayne King 2014-2-26
编辑:Wayne King 2014-2-26
If you want this to be a string, you need to enclose it in single quotest
filename = input('Type the name of the dxf-file:','s');
User enters:
'my_dxf_file.dxf'

类别

Help CenterFile Exchange 中查找有关 Bodies 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by