creating variable of specified length and same values

조회 수: 6 (최근 30일)
John
John 2013년 11월 15일
답변: ES 2013년 11월 15일
Hi,
How could I create a 4x1 variable of the value 1.2?
For example
1.2
1.2
1.2
1.2

채택된 답변

Aous Younis
Aous Younis 2013년 11월 15일
a=1.2*(ones(4,1))

추가 답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 11월 15일
편집: Azzi Abdelmalek 2013년 11월 15일
a=1.2;
a=a(ones(1,4))
%or
a=repmat(1.2,1,4)

ES
ES 2013년 11월 15일

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by