Filter löschen
Filter löschen

Creating a function in Matlab GUIDE gui other then the auto generated callbacks

1 Ansicht (letzte 30 Tage)
i have an issue.. i am new to matlab hence excuse me if my question is silly i have to generate the eucledian distance of two variables, hence i need to generate another function which calculates the eucledian value in the guide. i tried using the matlab function i.e.
function [d, q, a, b, f] = extendedEuclidean_forward(m1,a1);
but it gave me an error. i have a function shares_callback in which i need to call this eucledian function
function Shares_Callback(hObject, eventdata, handles)
% hObject handle to combineShares (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
M=m1*m2*m3;
a1=M/m1;
a2=M/m2;
a3=M/m3;
[d, q, a, b, f] = extendedEuclidean_forward(m1,a1);
end
please help, developing college project.
  2 Kommentare
Adam
Adam am 11 Mär. 2015
m1, m2, m3 are not defined in the scope of that callback.
The only variables in that scope at the start of the callback are hObject, eventdata and handles.
Most likely you want to have stored m1, m2 and m3 on the handles structure from wherever they came and then access them as
handles.m1, handles.m2, etc
Jason
Jason am 12 Mär. 2015
Bearbeitet: Jason am 12 Mär. 2015
Try making handles a variable in your function.
function [d, q, a, b, f] = extendedEuclidean_forward(handles,m1,a1);
And then call the fucntion via:
[d, q, a, b, f] = extendedEuclidean_forward(handles,m1,a1);

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Preshma Linet Pereira
Preshma Linet Pereira am 18 Mär. 2015
@adam i have done what you said.. that was an error..thanks ! @jason will implement and let you know

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by