|
"dine tiara" <namaqtia@gmail.com> wrote in message <ispsh0$2a4$1@newscl01ah.mathworks.com>...
> Dear all,
> I would like to show the matrix like this
> 0.5000 0.4028 0.3002 0.1917 0.0771 0.0437 0.1651 0.2926 0.4122
> 0.5000 0.3629 0.2984 0.1935 0.0806 0.0403 0.1613 0.2823 0.4032
> 0 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0
> 0.5000 0.3629 0.2984 0.1935 0.0806 0.0403 0.1613 0.2823 0.4032
>
> from a command window to GUI.
>
> I was try this script
> data_input=[[0.5;0.5;0;0.5] [0.40282664;0.362903226;1;0.362903226] [0.300158504;0.298387097;1;0.298387097] [0.191687708;0.193548387;1;0.193548387] [0.077073944;0.080645161;1;0.080645161] [0.043721018;0.040322581;1;0.040322581] [0.165105582;0.161290323;0;0.161290323] [0.292553108;0.282258065;0;0.282258065] [0.412202273;0.403225806;0;0.403225806] [0.5;0.5;0;0.5]]
> myString = sprintf(' %s %d',data_input);
> set(handles.text1, 'String', myString);
>
> but the output not same with my purpose.
> the output like this.
> .000000e-0015.000000e-00105.000000e-0014.028266e-0013.629032e-00113.629032e-0013.001585e-0012.983871e-00112.983871e-0011.916877e-0011.935484e-00111.935484e-0017.707394e-0028.064516e-00218.064516e-0024.372102e-0024.032258e-00214.032258e-0021.651056e-0011.612903e-00101.612903e-0012.925531e-0012.822581e-00102.822581e-0014.122023e-0014.032258e-00104.032258e-0015.000000e-0015.000000e-00105.000000e-001
>
> what should I do ???
try
myString = sprintf('%.4f\t',data_input);
|