I have a DE variable made up by 1xn. It is a row vector. After this I have a col_DE constant that is simply a number. I have to create from DE a matrix that is an made up by col_DE columns and n/col_DE rows. For example If I have a DE=1x56 double variable this new matrix will be made up by the same element of 1x56 (or 1xn in the general case). But if DE is a row vector I would like to obtain an array. I have to obtain a matrix where we need to go over again every col_DE elements. If you do this then we have a 8x7 array.How Can I do?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Feb. de 2014

0 votos

newDE = reshape(DE, 7, 8) .';

4 comentarios

Francesco
Francesco el 25 de Feb. de 2014
The .' was my problem. If I write simply
newDE = reshape(DE, 7, 8)
it reshape wrong for my aim. With .' you said: Make transposed element by element, is it right?
Walter Roberson
Walter Roberson el 25 de Feb. de 2014
Unlike the other dot-operations, .' does not mean "element by element". Instead .' means "plain transpose" and ' without the "." means "conjugate transpose".
' and .' are the same for real values, but I prefer to use .' to make my intentions clearer for anyone who might happen to want to adopt my code to use complex values.
Francesco
Francesco el 25 de Feb. de 2014
Walter, what's does plain mean? I've never heard this word!
Walter Roberson
Walter Roberson el 25 de Feb. de 2014
"plain" is "ordinary", "unexceptional", "does nothing unusual", "unadorned". In French, ordinaire, pur, simple.
The .' operator only switches the orientation. The . operator switches the orientation and also does complex conjugate.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 25 de Feb. de 2014

Comentada:

el 25 de Feb. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by