Matlab
write a Matlab function which deletes a first transferred parameter s1 in a second transferred parameter s.
e.g delte a letter in a sentence
For String function, we can use the following regular expression for removing particular string:
str = 'The quick brown fox jumped over the lazy dog';
strn = regexprep(str,'[tixy]','')
The above expression will help you to remove the desired string without using matlab function. Here we have used regular expressions and in the function we have passed the string along with the characters to be removed i.e. t,i,x,y in this case.
The function to be used is as follows:-
erase(str,match)
Syntax: newStr = erase(str,match)
Explanation: In this erase function 'match' helps us to remove all the occurences from the string. Then it returns the remaining string as 'newStr'.
If match is a string array or a cell array of character vectors, then erase deletes every occurrence of every element of match in str. The str and match arguments do not need to be the same size.
Matlab write a Matlab function which deletes a first transferred parameter s1 in a second transferred...
Write a python function alt which takes a list of strings myList as a parameter. alt then returns two strings s1 and s2 as a tuple (s1, s2). Here s1 is the concatenation of the strings in myList in even index positions, and s2 is the concatenation of the strings in myList in odd index positions. (List starts at index 0) For example, if myList = [‘My’, ‘kingdom’, ‘for’, ‘a’ , ‘horse’], then s1 = ‘Myforhorse’ and s2 = ‘kingdoma’.
Write a MATLAB function with the following specifications: Input parameter 1: A Input parameter 2: B Input parameter 3: C Input parameter 4: D Output parameter: Sum of the input parameters Time interval: -2T lessthanorequalto t lessthanorequalto 2T Waveform 1 to plot: y(t) = A sin(B(t - c))+D Waveform 2 to plot: y(t) = A cos(B(t - c)) + D Display two plots in vertical fashion on one figure Include all labeling on both plots. Add a grid to both...
Assume we have a linked list with 12 nodes pointed to by FIRST. Write a function that deletes the first node. Write a function that deletes the 7th node. Write a function that deletes the last node.
1) a) Write MATLAB function that accepts a positive integer parameter n and returns a vector containing the values of the integral (A) for n= 1,2,3,..., n. The function must use the relation (B) and the value of y(1). Your function must preallocate the array that it returns. Use for loop when writing your code. b) Write MATLAB script that uses your function to calculate the values of the integral (A) using the recurrence relation (B), y(n) for n=1,2,... 19...
PYHTON Write a function which takes a single parameter. The parameter is a list of integers. Your function should return a count of the number of integers in the list which are odd
****Using c++ (Check Substrings) Write the following function to check whether string s1 is a substring of string s2. The function returns the first index in s2 if there is a match. Otherwise, return -1. int indexOf(const string& s1, const string& s2) Write a test program that reads two strings and checks whether the first string is a substring of the second string.
Write the function in python and show the code 2. Write a function jscore (s1, s2) that takes two strings s1 and s2 as inputs and returns the Jotto score of s1 compared with s2 -.e., the number of characters in s1 that are shared by s2. The positions and the order of the shared characters within each string do not matter. Repeated letters are counted multiple times, as long as they appear multiple times in both strings. For example...
Write a matlab function called strip Write a function called strip which takes in a single string s, and returns a version of s with all the spaces removed. The format of the output is specified in the following examples >> strip ('This is a test') This is a test >> strip ('Another test') Another test
i need this done in Matlab 8. Write a function which reverses a vector, i.e. if the input is (4, 2, 1,5,-3], the output would be [-3,5, 1, 2,4]. 9. Write a function which computes the sum of every second element in a vector.
PYTHON 1- Write a function that receives a string value as a parameter, converts its first character to uppercase and returns the first character. 2- Test your function by writing a main, which calls your function and prints its return value. 3- Save your program in a file called firstChar.py and use the following link to submit your file.