%% Control Singular Value Output Format
% Create a 6-by-6 magic square matrix and calculate the SVD. By default, svd returns the singular values in a diagonal matrix when you specify multiple outputs.

A = magic(6);
[U,S,V] = svd(A)

%
% Specify the "vector" option to return the singular values in a column vector.

[U,S,V] = svd(A,"vector")

% If you specify one output argument, such as S = svd(A), then svd switches behavior to return the singular values in a column vector by default. In that case, you can specify the "matrix" option to return the singular values as a diagonal matrix.
% Copyright 2020 The MathWorks, Inc.