I am trying to get predefined dialog boxes to calculate arcsine of an argument I will put in a dialogue list. Bu what I do not understand is how I will get the answer arcsine(arg) to be written out in a message box, msbox. Someone who can help? The c
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to get predefined dialog boxes to calculate arcsine of an argument I will put in a dialogue list.
Bu what I do not understand is how I will get the answer arcsine(arg) to be written out in a message box, msbox.
Someone who can help? The code below doesnt work.
list = {'arcsine', 'arccosine', 'natural logarithm'};
[indx,tf] = listdlg('Liststring', list);
A = inputdlg({'Enter an argument'},'arcsine');
Y = asin(A)
msgbox(num2string(Y))
댓글 수: 0
답변 (1개)
DGM
2021년 4월 9일
Try something like this:
Y = asin(str2num(A{:}))
msgbox(sprintf('The arcsine of %s is %s',A{:},mat2str(Y,5)))
And this way also allows non-scalar inputs:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!