Info

This question is locked. 请重新打开它进行编辑或回答。

Help me to solve

60 次查看(过去 30 天)
N/A
N/A 2024-10-30,7:13
Locked: John D'Errico 2024-10-30,12:30
Using the zeros, ones, and eye commands create the following arrays:
(a)
1 0 0 1 1
0 1 0 1 1
(b)
0 0 1 1
0 0 1 1
0 0 0 0
1 1 1 1
(c)
1 1 0 0 1
1 1 0 0 0
1 1 0 0 0
1 1 0 0 0

回答(1 个)

Lokesh
Lokesh 2024-10-30,8:17
编辑:Lokesh 2024-10-30,8:21
Hello Teresa,
To achieve the desired outputs, you can split each array into sub-patterns, construct them individually, and then concatenate.
For example, for output (a), you can use:
a = [eye(2), zeros(2, 1), ones(2, 2)];
Try applying a similar approach to construct the remaining outputs.
Refer to the following documentation for more information on concatenating matrices in MATLAB:

This question is locked.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by