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!