MatlabGUI reads editable text and appears that this type of variable does not support indexing with dots

MatlabGUI reads editable text and appears that this type of variable does not support indexing with dots

foreword

   Recently, I have completed a large signal processing job, using the GUI in Matlab to implement a voice software graphical interface. Among them, it is necessary to enter another fig interface from one fig interface, independently select the audio file to read, enter the file address in the editable text, and read the audio file with audioread after reading the data.

question

   After the fig file of another GUI is designed, run it directly from the .m file (that is, do not enter the GUI from a GUI), and the data in the editable text can be read normally, but when entering the fig from a fig, this type of variable does not support using points for indexing, as shown in the figure below.

question

Solution

   After searching a lot of information on the Internet, it took a long time to find a solution. The reason is that the way the fig is opened, and the information in the editable text is read normally after changing the way the fig is opened.
   The statement used before to open the fig is

open('control.fig'); 

   The read statement is

path=get(handles.edit1,'string');

`Change the statement opened by fig to ``

set(control,'Visible','on');

Note: control is the name of the fig file you want to open.
   At this time, when you read the audio file again, the previous error will no longer appear: this type of variable does not support indexing with dots. After successful reading, the result is as follows: As above, the problem has been solved
insert image description here
   . Deliberately record it for others' reference.

Guess you like

Origin blog.csdn.net/qq_55600803/article/details/127002369