# change_row_to_column

## PURPOSE

Helper routine to transform 1d arrays into column vectors that are needed

## SYNOPSIS

function data=change_row_to_column(data)

## DESCRIPTION

     Helper routine to transform 1d arrays into column vectors that are needed
     by other routines in Chronux

     Usage: data=change_row_to_column(data)

     Inputs:
     data -- required. If data is a matrix, it is assumed that it is of the
     form samples x channels/trials and it is returned without change. If it
     is a vector, it is transformed to a column vector. If it is a struct
     array of dimension 1, it is again returned as a column vector. If it is a
     struct array with multiple dimensions, it is returned without change
     Note that the routine only looks at the first field of a struct array.

     Ouputs:
     data (in the form samples x channels/trials)

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- coherencyc Multi-taper coherency,cross-spectrum and individual spectra - continuous process
- evoked Function to calculate the evoked response given continuous data in the
- extractdatac Extract segements of continuous data between t(1) and t(2)
- findpeaks Helper function to find peaks in a given continuous valued time series x
- fitlinesc fits significant sine waves to data (continuous data).
- ftestc computes the F-statistic for sine wave in locally-white noise (continuous data).
- locdetrend Remove running line fit (using local linear regression)-continuous
- locsmooth Running line fit (using local linear regression) - 1d only, continuous
- mtdspecgramc Multi-taper derivative of the time-frequency spectrum - continuous process
- mtdspectrumc Multi-taper frequency derivative of the spectrum - continuous process
- mtfftc Multi-taper fourier transform - continuous data
- mtpowerandfstatc Multi-taper computation of the power and the fstatistic for a particular frequency - continuous process
- mtspecgramc Multi-taper time-frequency spectrum - continuous process
- mtspecgramtrigc Multi-taper event triggered time-frequency spectrum - continuous process
- mtspectrum_of_spectrumc Multi-taper segmented, second spectrum (spectrum of the log spectrum) for a continuous process
- mtspectrumc Multi-taper spectrum - continuous process
- mtspectrumsegc Multi-taper segmented spectrum for a univariate continuous process
- mtspectrumtrigc Multi-taper event triggered time-frequency spectrum - continuous process
- rmlinesc removes significant sine waves from data (continuous data).
- rmlinesmovingwinc fits significant sine waves to data (continuous data) using overlapping windows.
- extractdatapb Extract segements of binned point process data between t(1) and t(2)
- mtdspecgrampb Multi-taper derivatives of time-frequency spectrum - binned point process
- mtdspectrumpb Multi-taper spectral derivative - binned point process
- mtfftpb Multi-taper fourier transform - binned point process data
- mtspecgrampb Multi-taper time-frequency spectrum - binned point process
- mtspecgramtrigpb Multi-taper event triggered time-frequency spectrum - binned point process
- mtspectrumpb Multi-taper spectrum - binned point process
- mtspectrumsegpb Multi-taper segmented spectrum for a univariate binned point process
- mtspectrumtrigpb Multi-taper event triggered time-frequency spectrum - binned point process
- extractdatapt Extract segements of spike times between t(1) and t(2)
- mtdspectrumpt Multi-taper spectral derivative - point process times
- mtspecgrampt Multi-taper time-frequency spectrum - point process times
- mtspectrumpt Multi-taper spectrum - point process times
- mtspectrumsegpt Multi-taper segmented spectrum for a univariate binned point process
- mtspecgramc_slow Multi-taper time-frequency spectrum - continuous process

## SOURCE CODE

    0001 function data=change_row_to_column(data)
    0002 % Helper routine to transform 1d arrays into column vectors that are needed
    0003 % by other routines in Chronux
    0004 %
    0005 % Usage: data=change_row_to_column(data)
    0006 %
    0007 % Inputs:
    0008 % data -- required. If data is a matrix, it is assumed that it is of the
    0009 % form samples x channels/trials and it is returned without change. If it
    0010 % is a vector, it is transformed to a column vector. If it is a struct
    0011 % array of dimension 1, it is again returned as a column vector. If it is a
    0012 % struct array with multiple dimensions, it is returned without change
    0013 % Note that the routine only looks at the first field of a struct array.
    0014 %
    0015 % Ouputs:
    0016 % data (in the form samples x channels/trials)
    0017 %
    0018
    0019 dtmp=[];
    0020 if isstruct(data);
    0021    C=length(data);
    0022    if C==1;
    0023       fnames=fieldnames(data);
    0024       eval(['dtmp=data.' fnames{1} ';'])
    0025       data=dtmp(:);
    0026    end
    0027 else
    0028   [N,C]=size(data);
    0029   if N==1 || C==1;
    0030     data=data(:);
    0031   end;
    0032 end;