Matlab Assume that at each row of a 2D character array there is a string which can
Fantastic news! We've Found the answer you've been seeking!
Question:
Matlab
Transcribed Image Text:
Assume that at each row of a 2D character array there is a string which can have duplicate characters. Using Octave, write a function called "is existing" that will accept two inputs: An array (say X) with above-given properties, and another 2D character array (say Y) whose number of columns is equal to the number of columns of X. The number of rows of these two arrays can be different. The output will be a column vector whose number of rows is equal to the number of rows of Y. For any row of Y, if there exists a row of X that is composed of a permutation of the string given in this row of Y, the corresponding element of the output vector will be logical 1. Otherwise, it will be logical 0. (You may NOT use any built-in functions except size. length, rem and mod) Example: 133АВС36 'VZEL8A3V '9МЕНМЕТ9 '919EY9EN' 'C3C3C3C3' Y =631A3B3C' ЧЕТМ99МЕН) X = If Z-is_existing(X,Y), Z = 1 Assume that at each row of a 2D character array there is a string which can have duplicate characters. Using Octave, write a function called "is existing" that will accept two inputs: An array (say X) with above-given properties, and another 2D character array (say Y) whose number of columns is equal to the number of columns of X. The number of rows of these two arrays can be different. The output will be a column vector whose number of rows is equal to the number of rows of Y. For any row of Y, if there exists a row of X that is composed of a permutation of the string given in this row of Y, the corresponding element of the output vector will be logical 1. Otherwise, it will be logical 0. (You may NOT use any built-in functions except size. length, rem and mod) Example: 133АВС36 'VZEL8A3V '9МЕНМЕТ9 '919EY9EN' 'C3C3C3C3' Y =631A3B3C' ЧЕТМ99МЕН) X = If Z-is_existing(X,Y), Z = 1
Expert Answer:
Answer rating: 100% (QA)
clc clear all close all X133ABC36V2EL8A3V9MEHMET9919EY9EN YC3C3C3... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Use MATLAB to construct a matrix A by setting A = vander(1 : 6); A = A - diag(sum(A)) (a) By construction, the entries in each row of A should all add up to zero. To check this, set x = ones(6, l)...
-
Jaco has 11 different pamphlets which he wishes to put in 4 mail boxes labelled A, B, C and D. In how many different ways may he put the pamphlets in the mail boxes in such a way that mail box D gets...
-
Write a user-defined MATLAB function that calculates the determinant of a 3 3 matrix by using the formula: For the function name and arguments, use d3 = det3by3 (A), where the input argument A is...
-
Find the amplitude, period, and phase shift of function. Graph function. Show at least two periods. 2 3 - cos ( 6)
-
Calculate Vo in the circuit of Fig. 10.74. soo ki 100 30 FIG. 10.74 Proble 1S
-
Give an example that demonstrates the trade-off inherent in projects among cost, time, and performance.
-
Describe the consultative role of the ethics committee when addressing ethical dilemmas.
-
Determine the missing amounts (in millions) for the condensed balance sheets shownbelow. Costco $ 20,682 11,490 (c) Target $ 44,106 (a) 13,712 Wal-Mart $ (b) 98,906 64,608 Assets Liabilities...
-
A truck travels due east for a distance of 1.4 km, turns around and goes due west for 6.6 km, and finally turns around again and travels 2.7 km due east. (a) What is the total distance, in...
-
The American black bear (Ursus americanus) is one of eight bear species in the world. It is the smallest North American bear and the most common bear species on the planet. In 1969, Dr. Michael R....
-
Scaly Pete's son, Kyle, has decided to not go to college and be a DJ. Pete has consistently been putting annuity payments into a savings account for Kyle's college fund. Pete gives the account over...
-
One of the most dramatic stories of the last 30 years has been the rise of China as a global manufacturing hub. By 2018, China accounted for 28.4 percent of global manufacturing output. The United...
-
The vibrant market for Chinese IPOs in the United States was somewhat surprising given escalating trade tensions between the United States and China during 2018. However, for many Chinese tech firms,...
-
A hundred years ago, the South American nation of Argentina was one of the worlds wealthiest countries. Its success was based on rich natural resources, a productive agricultural sector, an educated...
-
The apparel industry in Bangladesh has been one of that countrys great success stories. Bangladesh is a densely populated nation of over 160 million people at the mouth of the Ganges River next door...
-
For the application listed above, identify runtime characteristics for an operational system. Choose characteristics that will support evaluation similar to that performed for Exercise 6.16. Data...
-
The trajectory of rockets on an amusement park ride lies on a circle of radius 190 feet. It takes 20 seconds to make one revolution. Determine the linear speed, in miles per hour. Linear Speed v= mph
-
If the cylinder described in Problem 21.3 were initially heated to 500F, how long would it take for the center of the cylinder to cool to 240F if it were constructed of a. Copper? b. Brass? c. Nickel?
-
For the half-circle area shown in the previous problem, show that the moment of inertia about the x axis, Ix, is given by Ix = 1/8 R4. The moment of inertia Ix can be calculated by: y? dA
-
The equivalent resistance, Req, of four resistors, R1, R2, R3, and R4, that are connected in parallel is given by: Req = 1/1/R1 + 1/R2 + 1/R3 + 1/R4 Calculate Req if R1 = 1200¦, R2 = 2200, R3...
-
The length |u| (magnitude) of a vector u = xi+ yj + zk is given by |u| = x2 + y2 + z2. Given the vector u = 23.5i - 17j + 6k, determine its length in the following two ways: (a) Define the vector in...
-
Describe which characteristics of HR metrics and workforce analytics are likely to result in greater return on investment and organizational impact.
-
Why are information security and privacy important considerations in the design, development, and maintenance of an HRIS?
-
List and discuss the major information security and privacy threats to organizations.
Study smarter with the SolutionInn App