Value from popup for a another calculation
조회 수: 1 (최근 30일)
이전 댓글 표시
function popupmenu3_Callback(hObject, eventdata, handles)
contents = cellstr(get(hObject,'String'));
Werkstoff= contents{get(hObject,'Value')};
if(strcmp(Werkstoff,'C25'))
Rm_N= 550; %MPa
Rp_N=600;
elseif(strcmp(Werkstoff,'C40'))
Rm_N=600;
Rp_N=800;
elseif(strcmp(Werkstoff,'C45'))
Rm_N=100;
Rp_N=5500;
end
I Choose one option from the popup and then i get values for Rm_N and Rp_N. What i need to do, when I want to use the Rm_N and Rp_N from my chosen option for my calculation in the bottom?
function pushbutton1_Callback(hObject, eventdata, handles)
% Zug-Druck
S_max_zd= *Rp_N*;
F_Max_zo= *Rm_N*/2;
set(handles.text39, 'string', S_max_zd);
set(handles.text40, 'string', F_max_zo);
댓글 수: 0
채택된 답변
Walter Roberson
2017년 11월 2일
댓글 수: 2
Walter Roberson
2017년 12월 27일
function popupmenu3_Callback(hObject, eventdata, handles)
contents = cellstr(get(hObject,'String'));
Werkstoff= contents{get(hObject,'Value')};
if(strcmp(Werkstoff,'C25'))
Rm_N= 550; %MPa
Rp_N=600;
elseif(strcmp(Werkstoff,'C40'))
Rm_N=600;
Rp_N=800;
elseif(strcmp(Werkstoff,'C45'))
Rm_N=100;
Rp_N=5500;
else
Rm_N = inf;
Rp_N = inf;
end
handles.Rm_N = Rm_N;
handles.Rp_N = Rp_N;
guidata(hObject, handles);
function pushbutton1_Callback(hObject, eventdata, handles)
% Zug-Druck
S_max_zd= handles.Rp_N;
F_Max_zo= handles.Rm_N/2;
set(handles.text39, 'string', S_max_zd);
set(handles.text40, 'string', F_max_zo);
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!