Question: A vector is given by x = [ 4 9 7 5 9 8 7 6 5 1 3 5 2 2 1 1 7
A vector is given by x
Using conditional statements, loops and your testprime function from previous step write a MATLAB program that creates two vectors from x The first vector call it P contains elements of x which are prime numbers, and the second vector call it N contains the nonprime elements of x In both P and N the elements are in the same order as in x At the end of the program, display P and N as follows:
The prime vector is:
The nonprime vector is:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
