Assume a general nelement sequent for write an expression in


Assume a general n-element sequent for write an expression in each a element of Comp up? with a general rate y_i the cappers the write a program so do the computing and to the x: 10, z, 14, 7, 9, 12, 31, 6, 4, 7 y: 10, 7, 31, 7 x: 10, 2, 14, 7, 9, 12, 31, 6, 4, 7 y: 0, 0, 10, 2, 14, 7, 9, 12, 31, 6, 4, 7

Solution

%first one starts here
x = [10 2 14 7 9 12 31 6 4 7];
[r c]=size(x);
index =1;
for i=1:3:c%takes the step 3, so that other two will be get skipped
newx(index)=x(i);
index = index+1;
end
disp(newx)

output:

10 7 31 7

%second one starts here
x = [10 2 14 7 9 12 31 6 4 7];
[r c]=size(x);
index =1;
for i=-1:c
if i<1%condition to insert two zeros in the beginning of the matrix
newx(index)=0;
else
newx(index)=x(i);
end
index = index+1;
end
disp(newx);

output:

Columns 1 through 7

0 0 10 2 14 7 9

Columns 8 through 12

12 31 6 4 7

 Assume a general n-element sequent for write an expression in each a element of Comp up? with a general rate y_i the cappers the write a program so do the comp

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site