Home > matpower7.0 > extras > syngrid > lib > sgvm_ensure_col_vect.m

sgvm_ensure_col_vect

PURPOSE ^

SGVM_ENSURE_COL_VECT make sure x is a column vector

SYNOPSIS ^

function x = sgvm_ensure_col_vect(x)

DESCRIPTION ^

SGVM_ENSURE_COL_VECT make sure x is a column vector
   X = SGVM_ENSURE_COL_VECT(X)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function x = sgvm_ensure_col_vect(x)
0002 %SGVM_ENSURE_COL_VECT make sure x is a column vector
0003 %   X = SGVM_ENSURE_COL_VECT(X)
0004 
0005 %   SynGrid
0006 %   Copyright (c) 2018, Power Systems Engineering Research Center (PSERC)
0007 %   by Eran Schweitzer, Arizona State University
0008 %
0009 %   This file is part of SynGrid.
0010 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0011 
0012 m = size(x,1); n = size(x,2);
0013 if (m ~= 1) && (n ~= 1)
0014     error('input x must be a vector! size = (%d,%d)\n', m, n)
0015 elseif n ~= 1
0016     x = x.';
0017 end

Generated on Mon 24-Jun-2019 15:58:45 by m2html © 2005