Question: Matlab - Computer Science The following MATLAB program is written to calculate the squares of all even integers between 0 and N (0 and N
Matlab - Computer Science

The following MATLAB program is written to calculate the squares of all even integers between 0 and N (0 and N are excluded), where N is a positive integer provided by the user. Then, the program creates a matrix of two columns such that the first column is for the even integers and the second is for their squares. N=input('Enter a positive value of N: "); Statement1 for i=1:N-1 Remod(1,2); if R=0 num(k)=1; Statement2 k==k+1; end end M=fnum num_sq]; disp(21) 1. The given script contains: a. 3 errors b. 2 errors c. 1 error d More than 3 errors 2. Statement l is: a. k=1: b. k=0: c. k=0 d. k=1 3. Statement 2 is: a num_s9(k)=num(k)^2; b. num_sq=i^2; cnum_sq(k)=num(k) *2; d. num_sq=num^2; 4. Line 11 should be replaced by: a. M=[num num_sq'l b. There is nothing wrong with line 11. It should remain as it is. c. M=[num num_sq]" d M=num se' num
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
