Rank: 3781 based on 7 downloads (last 30 days) and 2 files submitted
photo

Changqing Xu

E-mail

Personal Profile:
Professional Interests:
Image processing, computation

 

Watch this Author's files

 

Files Posted by Changqing View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
15 May 2010 a short code for creating a random (1,-1) matrix This is a very short code file for creating a random matrix whose entries are either 1 or -1. Author: Changqing Xu random matrix, binary, singularity, determinant 1 2
  • 1.0
1.0 | 2 ratings
20 Nov 2008 Matrix Permanent Computation of matrix permanent Author: Changqing Xu matrix, permanent, configuration 6 0
Comments and Ratings by Changqing View all
Updated File Comments Rating
02 Aug 2009 MAGIC - MATLAB Generic Imaging Component Tutorial GUI to demonstrate basic functionality of various controls on the GUI Author: Mark Hayworth

Great! A nice display on how to use gui to play vedio

12 Nov 2008 Video: GUIDE Basics Tutorial Five minute video about building GUIs in MATLAB. Author: Doug Hull
Comments and Ratings on Changqing's Files View all
Updated File Comment by Comments Rating
18 May 2010 a short code for creating a random (1,-1) matrix This is a very short code file for creating a random matrix whose entries are either 1 or -1. Author: Changqing Xu Jos (10584)

Indeed poorly coded using an unnecessary double-for loop (with pre-allocation though!), limited to 2D sqaure matrices only.

A vectorized, (too!) simple and flexible approach:

function R = rand01(varargin)
% H1 line goes here
% help goes here
R = 2*(rand(varargin{:})>0.5)-1 ;

17 May 2010 a short code for creating a random (1,-1) matrix This is a very short code file for creating a random matrix whose entries are either 1 or -1. Author: Changqing Xu Tursa, James

This submission has the following problems:
1) It uses a double for loop to individually fill in each element of the resulting matrix rather than using vectorized code.
2) It uses the relatively expensive power operator to generate the +1 and -1 values.
3) The H1 line function name does not match the actual function name.
4) A much faster (more than 3x faster) one-liner equivalent to this submission is as follows: floor(rand(n)*2)*2-1
5) There is no provision for non-square or multi-dimensional sizes. Only square 2D sizes are supported.

James Tursa

Top Tags Applied by Changqing
binary, configuration, determinant, matrix, movie
Files Tagged by Changqing View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
15 May 2010 a short code for creating a random (1,-1) matrix This is a very short code file for creating a random matrix whose entries are either 1 or -1. Author: Changqing Xu random matrix, binary, singularity, determinant 1 2
  • 1.0
1.0 | 2 ratings
19 Jun 2009 Screenshot MAGIC - MATLAB Generic Imaging Component Tutorial GUI to demonstrate basic functionality of various controls on the GUI Author: Mark Hayworth demo, gui example, gui, play, batch processing, movie 72 1
  • 4.0
4.0 | 7 ratings
20 Nov 2008 Matrix Permanent Computation of matrix permanent Author: Changqing Xu matrix, permanent, configuration 6 0

Contact us at files@mathworks.com