creating variable of specified length and same values

6 Ansichten (letzte 30 Tage)
John
John am 15 Nov. 2013
Beantwortet: ES am 15 Nov. 2013
Hi,
How could I create a 4x1 variable of the value 1.2?
For example
1.2
1.2
1.2
1.2

Akzeptierte Antwort

Aous Younis
Aous Younis am 15 Nov. 2013
a=1.2*(ones(4,1))

Weitere Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 15 Nov. 2013
Bearbeitet: Azzi Abdelmalek am 15 Nov. 2013
a=1.2;
a=a(ones(1,4))
%or
a=repmat(1.2,1,4)

ES
ES am 15 Nov. 2013

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by