フィルターのクリア

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

1 回表示 (過去 30 日間)
Preshma Linet Pereira
Preshma Linet Pereira 2015 年 3 月 11 日
回答済み: Preshma Linet Pereira 2015 年 3 月 18 日
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 件のコメント
Adam
Adam 2015 年 3 月 11 日
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 2015 年 3 月 12 日
編集済み: Jason 2015 年 3 月 12 日
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);

サインインしてコメントする。

回答 (1 件)

Preshma Linet Pereira
Preshma Linet Pereira 2015 年 3 月 18 日
@adam i have done what you said.. that was an error..thanks ! @jason will implement and let you know

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by