Create array Arr with 5 rows and 4 columns with each element = 5

29 次查看(过去 30 天)
vArr = [ 5 6 7 8; 2 3 4 5 ; 2 3 4 5; 2 3 4 5; 2 3 4 5 ]
but what does it mean with each element = 5 all number has to be 5???

回答(2 个)

James Tursa
James Tursa 2019-9-26
编辑:James Tursa 2019-9-26
Yes. Replace all of your numbers with 5 and you will have it. E.g.,
Arr = [5 5 5 5; etc.
This is the hardest way to accomplish the result, but it does work.

raghav
raghav 2024-2-24
CODE TO CREATE ARRAY OF ALL ELEMENTS OF 5 WITH 5 ROWS AND 4 COLUMNS
Arr=5*ones(5,4)
Arr = 5×4
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile 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