make a matrix from

1 次查看(过去 30 天)
Lev Mihailov
Lev Mihailov 2019-11-7
I am given numbers 2, 4 and 8, I need to make three matrices from them, format 3x3.1x10 (this will already be a vector) and 2x4
X=[2 2 2: 2 2 2: 2 2 2] Y=[4 4 4 4 4 4 4 4 4 4 ]
example example how it should look. Is it possible to do this automatically? Preferably without cycles

回答(1 个)

JESUS DAVID ARIZA ROYETH
x=repmat(2,3,3)
y=repmat(4,1,10)

类别

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