write m script file or create matrix

8 次查看(过去 30 天)
i want write m script file for create 5x4 matrix in which first two rows are zeros and last three rows are ones.how do i create this

采纳的回答

Prasad Reddy
Prasad Reddy 2020-4-23
A=zeros(2,4) % creaes a 2X4 matrix of zeros
B=ones(3,4) % creates a 3X4 matrix of ones.
c=[A;B] % combinng thoe two matixs
% this code will produce the required matrix
  2 个评论
Rik
Rik 2020-4-23
Please don't post complete solutions to homework questions.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by