Respuesta aceptada

Paulo Silva
Paulo Silva el 24 de Abr. de 2011

0 votos

In MATLAB a "scalar" is a vector with just one element, for example [1] is the same as 1
here's a sneaky way to separate all the digits of a scalar into columns of a vector
nc=1010; %my scalar value
nv=num2str(n)-'0' %my vector

Más respuestas (2)

Walter Roberson
Walter Roberson el 24 de Abr. de 2011

1 voto

If S is your scalar, you can use any of the following:
reshape(S,1,[])
reshape(S,[],1)
S(:)
S.'
S(end) = S;
kron(S,1)
full(sparse(S))
Oleg Komarov
Oleg Komarov el 24 de Abr. de 2011

0 votos

I think he intends to repmat the scalar.

1 comentario

Walter Roberson
Walter Roberson el 24 de Abr. de 2011
Considering the other active questions by the user, I doubt that myself.

Iniciar sesión para comentar.

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by