unable to input using filename (dxf)

조회 수: 1 (최근 30일)
Ellen
Ellen 2014년 2월 26일
편집: Mischa Kim 2014년 2월 26일
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