A = [-1000:1:1000] write a script file that gives the positive
numbers greater than 480 and
divisible by 3.
Hint: Use this command if
A(i)>480&&(rem(A(i),3)==0)
and indeed, if is always accompanied by an end
Note: Using Matlab
Hey,
Please find the below MATLAB code which generates all the numbers within ranges of A which are GREATER THAN 480 AND DIVISIBLE by 3 :-
A = [-1000 : 1 :1000]
disp("All the numbers within the ranges of 'A' which are greater
than 480 and divisible by 3::");
for i = 1:length(A)
if((mod(A(i),3)==0) && A(i) > 480 )
disp(A(i));
end
end
OUTPUT:-
The Output being lengthy.... so needed to divide the output screenshot in 3 parts. :)
Thanks.
Get Answers For Free
Most questions answered within 1 hours.