write m script file or create matrix

8 views (last 30 days)
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
  1 Comment
Rik
Rik on 21 Apr 2020
You can find guidelines for posting homework on this forum here.

Sign in to comment.

Accepted Answer

Prasad Reddy
Prasad Reddy on 23 Apr 2020
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 Comments
Rik
Rik on 23 Apr 2020
Please don't post complete solutions to homework questions.
Rashmi Amarathunga
Rashmi Amarathunga on 25 Apr 2020
Thank you for ur answer.it works

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!