Code covered by the BSD License  

Highlights from
spiral_decomp

Be the first to rate this file! 1 Download (last 30 days) File Size: 1.59 KB File ID: #25130

spiral_decomp

by Athanasios Makris

 

25 Aug 2009

Function spiral_decomp decomposes a given matrix into a row vector following spiral order.

| Watch this File

File Information
Description

INPUTS
------
A = An n x m matrix (real or complex)

OUTPUTS
-------
y = An (1 x (n * m) ) vector containing the elements of A taking in spiral order.

COMPATIBILITY
-------------
Matlab 7.2 and later
 
NOTE
-----------
This function utilizes function matrix_perimeter.m
               
EXAMPLE
------------

>> A=magic(5)

 A =

     17 24 1 8 15
     23 5 7 14 16
      4 6 13 20 22
     10 12 19 21 3
     11 18 25 2 9

 >> x=spiral_decomp(A)

 x =

   Columns 1 through 14

     17 24 1 8 15 16 22 3 9 2 25 18 11 10

   Columns 15 through 25

      4 23 5 7 14 20 21 19 12 6 13

MATLAB release MATLAB 7.5 (R2007b)
Other requirements Requires matrix_perimeter.m which can be found in Matlab File Exchange Repository.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
matrix manipulation Athanasios Makris 26 Aug 2009 05:11:17
matrix Athanasios Makris 26 Aug 2009 09:28:15

Contact us at files@mathworks.com