You are on page 1of 2

DSP-LAB-1-Task

SUBMITTED BY: SHAZIR ALI KHAN


REG NO # SP18-BTN-004
SUBMITTED TO: Maam Zenab Fazal
DATE: 25 August, 2020
Question 1:-

Ans:
A=[1,2;3,4;5,6]
temp=A(2,:); % Interchange row 2nd and 3rd
A(2,:)=A(3,:);
A(3,:)=temp

Question 2:-

Ans:
r=randi([0 10],10,10) % 10 by 10 matrix with random numbers
b/w 0 to 10
r(1,:)=1
r(:,1)=1

Question 3:-

Ans:
x=zeros(1,200) % row of 200 zero elements
x(:,1)=8
x(:,2)=6
x(:,3)=4
x(:,4)=2
x(:,200)=10

You might also like