채택된 답변

Paulo Silva
Paulo Silva 2011년 4월 24일

0 개 추천

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

추가 답변 (2개)

Walter Roberson
Walter Roberson 2011년 4월 24일

1 개 추천

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 2011년 4월 24일

0 개 추천

I think he intends to repmat the scalar.

댓글 수: 1

Walter Roberson
Walter Roberson 2011년 4월 24일
Considering the other active questions by the user, I doubt that myself.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by