Answered Same DayOct 16, 2021

Answer To: Matlab

Nishchay answered on Oct 17 2021
116 Votes
NewArray.m
function B = NewArray(A,b)
B=A; %preallocation of output
[m,n]=size(A); %row and colum
n number for index
L=length(b);
for i=1:min(m,n)
if (i<=L)
B(i,i)=B(i,i)+b(i);
else
B(i,i)=B(i,i)+0;
end
end
PositiveArray.m
function P = PositiveArray(A)
P=zeros(size(A)); %preallocation of output
[m,n]=size(A); %row and column number for index
for i=1:m
for j=1:n
if (A(i,j)>=0)
P(i,j)=A(i,j);
else
P(i,j)=A(i,j)^2;
end
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here