MATLAB: Display value in message box

display-message-box-matlab

hi, please help.
i create a multiple choice box and then display value of a in a message box but i don't know how to put the value of 'a' in the message box.
close all
clear all
choice = menu('Choose optical fiber type','Single-mode fiber ( G.652 )','Dispersion-shifted fiber ( G.653 )','Non-zero dispersion-shifted fiber ( G.655 )');
if choice==1
a=1;
elseif choice==2
a=2;
else
a=3;
end
h = msgbox(Message)

Best Answer

Is this:
h = msgbox(sprintf('You chose %d',a))
something like what you want to do?
Related Question