Error clicking the GUI interface button in matlab
Mostrar comentarios más antiguos
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-0.
Error in matriz_destino (line 10)
mat(2,1) = double(char(get(findobj(gcf,'Tag','p14'),'String')));
Error while evaluating UIControl Callback.
---------------------------
Incapaz de realizar a atribuição porque o tamanho do lado esquerdo é 1 por 1 e o tamanho do lado direito é 1 por 0.
Erro em matriz_destino (linha 10)
mat (2,1) = double (char (get (findobj (gcf, 'Tag', 'p14'), 'String')));
Erro ao avaliar o retorno de chamada UIControl.
2 comentarios
Guilherme Alves
el 28 de Ag. de 2020
Editada: Adam Danz
el 28 de Ag. de 2020
"the size of the right side is 1-by-0"
"o tamanho do lado direito é 1 por 0"
The result on the right side of the equal sign is empty.
This could be because findobj(gcf,'Tag','p11') is not finding any objects:
findobj(gcf,'Tag','p11')
ans =
0×0 empty GraphicsPlaceholder array.
double(char(get([],'String')))
ans =
[]
But even if it did find the correct object, it doesn't look like you're converting the string correctly. After you figure out the correct findobj() inputs, assuming the string is a number, try,
h = findobj(____);
mat(5,1) = str2double(get(h,'string'));
% or
mat(5,1) = str2double(h.String);
Respuestas (0)
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!