help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave UPM problem


From: James Sherman Jr.
Subject: Re: Octave UPM problem
Date: Sat, 16 Mar 2013 17:51:24 -0400

On Sat, Mar 16, 2013 at 5:36 PM, rufsiany <address@hidden> wrote:
> Hello,
> I've been searching for some GUI front end for Octave for some time and just
> today came across the brilliant Octave UPM. But after playing around for a
> few minutes, I found that sometimes multiplying matrix by a scalar doesn't
> give the correct results. I don't have Octave 3.6.2 compiled with VS, which
> UPM Octave is based on, but the mingw version 3.6.2, I use, behaves
> correctly.
>
> In the example below of the UPM version, the matrix is a result of calling
> the "wienrnd" function. Multiplying it by 5 gives strange results:
>
>
>>> wnr = wienrnd (2,8,8)
> wnr =
>
>   0.12500  -0.14346  -0.00996  -0.01769  -0.09809  -0.29141  -0.66246
> 0.21502  -0.05021
>   0.25000  -0.32987  0.36572  -0.19571  -0.47057  -0.26569  -0.48931
> -0.19764  -0.19126
>   0.37500  -0.89128  -0.40626  -0.24054  -0.79434  -0.07082  -1.17389
> 0.01741  0.31736
>   0.50000  -1.30473  -1.08801  -0.15474  -0.57085  -0.33015  -1.13230
> -0.15042  0.57384
>   0.62500  -0.97855  -1.45742  -0.11478  -0.24397  -0.76436  -1.12999
> -0.26776  0.17453
>   0.75000  -0.63273  -1.71002  0.55411  1.22800  -0.97141  -1.39005
> -0.52772  0.45839
>   0.87500  -0.52147  -1.66481  0.20736  1.00382  -0.81109  -0.97733
> -0.49950  -0.35432
>   1.00000  0.03512  -1.02482  -0.11592  0.82814  -1.20891  -1.20896
> -0.84940  -0.19286
>   1.12500  0.32241  -0.53098  0.05954  0.94293  -1.03769  -1.79697  -1.00988
> 0.12688
>   1.25000  0.02102  -0.21186  0.40525  0.67732  -0.65204  -1.85381  -0.74743
> -0.37683
>   1.37500  0.57876  -0.35670  0.55405  0.68633  -0.47886  -1.03869  -0.68177
> -0.43835
>   1.50000  0.63651  -0.15772  0.28846  0.85061  -0.21789  -0.78991  -0.10397
> -0.14196
>   1.62500  0.54970  -0.19866  0.50000  0.64156  -0.09773  -0.84530  -0.83896
> -0.00997
>   1.75000  0.44090  -0.77706  0.46982  0.92536  0.07399  -0.76027  -0.71449
> 0.11840
>   1.87500  0.47665  -0.80388  0.41928  0.89688  -0.39765  -0.80179  -0.77270
> -0.43913
>   2.00000  0.35018  -1.07899  0.12233  1.14020  -0.82989  -0.57488  -0.72834
> -0.48806
>
>>> wnr * 5
> ans =
>
>   1.0e+001 *
>
>   0.06250  -0.07173  -0.00498  -0.00884  -0.04904  -0.14571  -0.33123
> 0.10751  -0.02511
>   0.12500  -0.16493  0.18286  -0.09785  -0.23529  -0.13284  -0.24465
> -0.09882  -0.09563
>   0.18750  -0.44564  -0.20313  -0.12027  -0.39717  -0.03541  -0.58695
> 0.00871  0.15868
>   0.25000  -0.65236  -0.54400  -0.07737  -0.28543  -0.16508  -0.56615
> -0.07521  0.28692
>   0.31250  -0.48928  -0.72871  -0.05739  -0.12198  -0.38218  -0.56500
> -0.13388  0.08726
>   0.37500  -0.31636  -0.85501  0.27706  0.61400  -0.48570  -0.69503
> -0.26386  0.22919
>   0.43750  -0.26074  -0.83240  0.10368  0.50191  -0.40555  -0.48867
> -0.24975  -0.17716
>   0.50000  0.01756  -0.51241  -0.05796  0.41407  -0.60446  -0.60448
> -0.42470  -0.09643
>   0.56250  0.16120  -0.26549  0.02977  0.47147  -0.51884  -0.89848  -0.50494
> 0.06344
>   0.62500  0.01051  -0.10593  0.20262  0.33866  -0.32602  -0.92690  -0.37372
> -0.18842
>   0.68750  0.28938  -0.17835  0.27703  0.34317  -0.23943  -0.51935  -0.34088
> -0.21917
>   0.75000  0.31826  -0.07886  0.14423  0.42530  -0.10894  -0.39496  -0.05199
> -0.07098
>   0.81250  0.27485  -0.09933  0.25000  0.32078  -0.04887  -0.42265  -0.41948
> -0.00498
>   0.87500  0.22045  -0.38853  0.23491  0.46268  0.03700  -0.38014  -0.35725
> 0.05920
>   0.93750  0.23833  -0.40194  0.20964  0.44844  -0.19882  -0.40089  -0.38635
> -0.21956
>   1.00000  0.17509  -0.53950  0.06116  0.57010  -0.41495  -0.28744  -0.36417
> -0.24403
>
>>>
>
> Cheers
> Greg
>
>
>
> --
> View this message in context: 
> http://octave.1599824.n4.nabble.com/Octave-UPM-problem-tp4650871.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave

The key is in the first part of the "ans" display:
>>> wnr * 5
> ans =
>
>   1.0e+001 *
>

This means that its displaying the results in scientific notation this
the first entry is:
 1.0e+001 * 0.06250 = 0.625
The desired result.

This doesn't have to do with any GUI, but normal operation.  Type
'help format' for ways to change how outputs are displayed.

Hope this helps,

James Sherman


reply via email to

[Prev in Thread] Current Thread [Next in Thread]