Where can I insert my Operation and How to display the result in Static Text?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
acosep
el 23 de Mzo. de 2015
Comentada: Elias Gule
el 24 de Mzo. de 2015
I was trying to insert this operation: F=a1+a2+a3+a4+a5+a6+a7+a8+a9;(BUT IM GETTING THIS ERROR Undefined function or variable 'a1'. Error in Determinants>pushbutton1_Callback (line 335) F=a1+a2+a3+a4+a5+a6+a7+a8+a9;)
and display the determinants of F by using this det(F); in static text but I don't know how.
1 comentario
Elias Gule
el 24 de Mzo. de 2015
In your pushbutton1_Callback: define a matrix 3 x 3 matrix.
M = zeros(3,3);
count = 0;
for k = 1 : 3
for l = 1 : 3
count = count + 1;
key = ['a' num2str(count)];
val = str2double(get(handles.(key),'String'));
M(l,k) = val;
end
end
set(handles.results,'String',num2str(det(M)));
where a1:a9 are represents tags for each text component assigned in a columnwise manner. GUIDE stores references to each component in the handles structure; this enables easy communication between the components. The hObject in the object's callback represents the current object; that is the object to which the callback is assigned.
So if you ever use guide for your GUIs, then the handles structure is your friend!!!
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Environment and Settings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!