
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
MATLAB question
For input
![For input vector x, write a function to check whether there exists exactly 4 elemtents in x which are divisible by 3.
Example:
If input x = [2 5 8 3 1 4], then output y is false or 0.
If input x = [2 5 8 3 1 6 4 0 –3], then output y is true or 1.
Hint: You may find the MATLAB command mod( ) to be useful.](https://content.bartleby.com/qna-images/question/1468cec0-0b11-49ea-bec1-6da78e2d0483/2ecf833e-6f6e-46b6-aed8-76bd80232c2f/591j91a_thumbnail.png)
Transcribed Image Text:For input vector x, write a function to check whether there exists exactly 4 elemtents in x which are divisible by 3.
Example:
If input x = [2 5 8 3 1 4], then output y is false or 0.
If input x = [2 5 8 3 1 6 4 0 –3], then output y is true or 1.
Hint: You may find the MATLAB command mod( ) to be useful.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Using Matlab Write a function that takes one input: A matrix with m rows and n columns. It should return one output: The product of all of the odd numbers inside of that matrix. Recall that rem(n,2) will return 1 when n is odd and 0 when n is even.arrow_forwardUse minimum 8 functions of vector STL. Write a program to explain the same.arrow_forwardMatlab questionarrow_forward
- Return co-ordinate 1 from (vector 3 1 4 2). In Racketarrow_forwardUsing a built-in function, create a vector vec which consists of 20 equally spaced points that range of -pi to +pi in MATLABarrow_forwardPlay and practice all the functions that we listed here. What I would like you to do is to first create three vectors---a logic vector, a double vector, and a character vector, for example, x1 = c( TRUE, FALSE, TRUE) x2 = c( 0, -2.5, 1, 3, 5.9 ) x3 = c( "a1", "a2", "za", "zz", "0", "1") and apply each function to all three vectors to see what would happen. If the function requires more than one input x, then you just create other objects as needed. sum (x) sum of the elements of x prod (x) product of the elements of x max (x) maximum of the elements of x min(x) minimum of the elements of x which. max (x) returns the index of the greatest element of x which. min(x) returns the index of the smallest element of x range (x) id. than c (min(x), max (x)) length (x) number of elements in x mean (x) mean of the elements of x median (x) median of the elements of x round (x, n) rounds the elements of x to n decimals rev…arrow_forward
- Write a function to nd the prime factors of an input number, not 0. The function should take an integer and output a vector whose entries are the prime factors of the input. These entries can be repeated ie. if you multiply all the entries you should get the original number. If the input equals to 0, print an error and output the empty vector [ ]. If the input equals to 1, output just the number 1. Do not use the Matlab function factor() to solve this problem. 1arrow_forwardWrite an inline function to compute the perimeter of a rectangle of length l and width w (both l and w integers.)arrow_forwardMatlabarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education