Prompt user input for table inputdlg
이전 댓글 표시
I have an issue:
I want an user defined input such as the "input" command in an m code file. But when i use the inputdlg and input a series of data it comes out as a
[11x4 char]
instead of a 11x1 variable that can be used in the rest of the code
I want the user to input a range of values from an excel sheet into the inputdlg and then that gets used in the rest of the code.
I hope this makes sense.
댓글 수: 2
Azzi Abdelmalek
2014년 1월 12일
post your code, and explain your problem?
Jonathan Wilson
2014년 1월 13일
답변 (1개)
Walter Roberson
2014년 1월 13일
0 개 추천
inputdlg() always returns a cell array of strings. You can use str2double() to parse each line if you are expecting exactly one value per line. See Example 2 in http://www.mathworks.com/help/matlab/ref/inputdlg.html
댓글 수: 2
Jonathan Wilson
2014년 1월 14일
Walter Roberson
2014년 1월 14일
>> str2double({'456.9'; '345.7'})
ans =
456.9
345.7
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!