Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab I need the code Write a Script file run divisiblity_check.m. Run a for loop from 1 to 100 with an increment of divisible by

image text in transcribed
Matlab
I need the code
Write a Script file "run divisiblity_check.m. Run a for" loop from 1 to 100 with an increment of divisible by 2, 3, both or neither. rem) command in variable when divided by a particular number. For instance, if x-3, rem(x, 2) would return I and if x 2, rem(x, 2) would be 0. Do a help on rem 0 command if you need more details and use it accordingly for the problem in hand. Results from I to 30 is shown in Figure 1. Note: You have to implement the code for numbers from 1 to 100. I and using if-else statements print whether the current number in the loop is MATLAB tells the remainder of a 1 is not divisible by 2 or 2 is divisible by 2 3 is divisible by 3 4 is divisible by 2 5 is not divisible by 2 or 3 6 is divisible by 2 and 3 7 is not divisible by 2 or 3 8 is divisible by 2 9 is divisible by 10 is divisible by 2 11 is not divisible by 2 or 3 12 is divisible by 2 and 13 is not divisible by 2 or 3 14 is divisible by 2 15 is divisible by 3 16 is divisible by 2 17 is not divisible by 2 or 3 18 is divisible by 2 and 3 19 is not divisible by 2 or 3 20 is divisible by2 21 is divisible by 3 22 is divisible by 2 23 is not divisible by 2 or 3 24 is divisible by 2 and 3 25 is not divisible by 2 or 3 26 is divisible by 2 27 is divisible by 3 28 is divisible by 2 29 is not divisible by 2 or 3 30 is divisible by 2 and 3 Figure 1: Results from 1-30 Write a Script file "run divisiblity_check.m. Run a for" loop from 1 to 100 with an increment of divisible by 2, 3, both or neither. rem) command in variable when divided by a particular number. For instance, if x-3, rem(x, 2) would return I and if x 2, rem(x, 2) would be 0. Do a help on rem 0 command if you need more details and use it accordingly for the problem in hand. Results from I to 30 is shown in Figure 1. Note: You have to implement the code for numbers from 1 to 100. I and using if-else statements print whether the current number in the loop is MATLAB tells the remainder of a 1 is not divisible by 2 or 2 is divisible by 2 3 is divisible by 3 4 is divisible by 2 5 is not divisible by 2 or 3 6 is divisible by 2 and 3 7 is not divisible by 2 or 3 8 is divisible by 2 9 is divisible by 10 is divisible by 2 11 is not divisible by 2 or 3 12 is divisible by 2 and 13 is not divisible by 2 or 3 14 is divisible by 2 15 is divisible by 3 16 is divisible by 2 17 is not divisible by 2 or 3 18 is divisible by 2 and 3 19 is not divisible by 2 or 3 20 is divisible by2 21 is divisible by 3 22 is divisible by 2 23 is not divisible by 2 or 3 24 is divisible by 2 and 3 25 is not divisible by 2 or 3 26 is divisible by 2 27 is divisible by 3 28 is divisible by 2 29 is not divisible by 2 or 3 30 is divisible by 2 and 3 Figure 1: Results from 1-30

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

=+j Improve the effectiveness of global and virtual teams.

Answered: 1 week ago