Question

A = [-1000:1:1000] write a script file that gives the positive numbers greater than 480 and...

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

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a matlab script file to solve the differential equation dy/dt = 1 − y^3 with...
Write a matlab script file to solve the differential equation dy/dt = 1 − y^3 with initial condition y(0)=0, from t=0 to t=10. matlab question
Write a script to display numbers from 1 to n, where n is an integer provided...
Write a script to display numbers from 1 to n, where n is an integer provided by users (if not, default to 10). Hint: use “read” command to accept user input. a) Display the source code in an editor (#4-9) b) Execute your script in the terminal, and display the command and the result (#4-10)
1- Create a new script that is called HW9.m and save it. The script will do...
1- Create a new script that is called HW9.m and save it. The script will do the following. Test your code for each of the cases and upload your script as a .m file. [15 points] a. Create a random integer numbers that goes from 0 to 5 and assign it to a variable y using rand and round commands. Hint: Note that rand function only creates random number between 0 and 1. You need to scale the values to...
Write a PowerShell script to get a Summary of 1 to 1000. i.e. Calculate the total...
Write a PowerShell script to get a Summary of 1 to 1000. i.e. Calculate the total of “1+2+3+4+5+6+7…+998+999+1000” You must use loop to do the calculation. Hint: The total is “500500” Manual summary of $Sum=1+2+3+4… is NOT acceptable. Using formula like $Sum= n(n+1)/2 is NOT acceptable.
MATLAB Write a script "readFile.m" which:   a. reads a given file "file.dat" into a matrix "XYZ",  ...
MATLAB Write a script "readFile.m" which:   a. reads a given file "file.dat" into a matrix "XYZ",   b. extracts the columns of the data from "XYZ" into arrays "c1", "c2", ..., "cN",   c. plots some column versus another column, with a title, and labeled axes.   To test and debug your code, create a "file.dat" with 3 rows and N=2 columns ( so a 3×2 matrix ).   The first column should be sorted. You can just enter some numbers in "file.dat" in...
An integer 'n' greater than 1 is prime if its only positive divisor is 1 or...
An integer 'n' greater than 1 is prime if its only positive divisor is 1 or itself. For example, 2, 3, 5, and 7 are prime numbers, but 4, 6, 8, and 9 are not. Write a python program that defines a function isPrime (number) with the following header: def isPrime (number): that checks whether a number is prime or not. Use that function in your main program to count the number of prime numbers that are less than 5000....
In Matlab, write a function that takes a relatively small (less than 100 billion) positive integer...
In Matlab, write a function that takes a relatively small (less than 100 billion) positive integer input and outputs the prime factorization of that integer using as few built-in functions as possible. Explain the processes with comments. NOTE: Do not use the functions factor(n), primes(n), or isprime(n). You should be able to write out what these functions do yourself if you want to be able to do something similar.
Lab 6    -   Program #2   -   Write one number to a text file. Use the write()...
Lab 6    -   Program #2   -   Write one number to a text file. Use the write() and read() functions with binary                                                        data, where the data is not char type.              (Typecasting is required) Fill in the blanks, then enter the code and run the program. Note:   The data is int type, so typecasting is            required in the write() and read() functions. #include <iostream> #include <fstream> using namespace std; int main() {    const int SIZE = 10;   ...
Activity 6.6. (a) A positive integer that is greater than 11 and not prime is called...
Activity 6.6. (a) A positive integer that is greater than 11 and not prime is called composite. Write a technical definition for the concept of composite number with a similar level of detail as in the “more complete” definition of prime number. Note. A number is called prime if its only divisors are 1 and itself. This definition has some hidden parts: a more complete definition would be as follows. A number is called prime if it is an integer,...
Use C++ Write a program that first reads in how many whole numbers the user wants...
Use C++ Write a program that first reads in how many whole numbers the user wants to sum, then reads in that many whole numbers, and finally outputs the sum of all the numbers greater than zero, the sum of all the numbers less than zero (which will be a negative number or zero), and the sum of all the numbers, whether positive, negative, or zero. The user enters the numbers just once each and the user can enter them...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT