MATLAB Answers

input vector fra edit text in guide GUI

조회 수: 7(최근 30일)
polo Mahmoud
polo Mahmoud 25 Feb 2020
댓글: polo Mahmoud 25 Feb 2020
I have used this code:
MVSENS=str2double(get(handles.edit27, 'String'))
it works fine for a single number like eg. 25, but i want to input a vector like this:
[1 2 3 4 5 6 ]
how do i do that from the edit text box in guide GUI

  댓글 수: 0

Sign in to comment.

채택된 답변

Adam
Adam 25 Feb 2020
편집: Adam 25 Feb 2020
sscanf( str, '%d' )
or
str2num( str )
would both work if the input is e.g. "1 2 3 4 5 6", although the first returns a column vector, but you can easily transpose it if you wish. The latter still works if you input "[1 2 3 4 5 6]" too.

  댓글 수: 1

polo Mahmoud
polo Mahmoud 25 Feb 2020
thank you :D

Sign in to comment.

추가 답변(0개)

태그


Translated by