Problem 1: Write a function ProcessiClicker to take any sized table as an input with at least two string column variables LastName and Firstname, and removes any leading and trailing whitespace from variables in LastName and Firstname, and combines the resulting two columns variables into one column named StudentName, with only comma between the last name and the first names. For example, if one record entry in Lastname and Firstname contains " Jones " and " Adam", the final result should be "Jones,Adam" and be placed in StudentName (note no space after the comma and that leading and trailing spaces have been removed). The result should be placed in a output table containing the same information as the input table, except there is a new column StudentName, and the table does not contain the column variables LastName and Firstname.
function table_out=ProcessiClicker(table_in)
% Inputs: table_in: table of any size with two column variables LastName and Firstname
% Outputs: table_out: same information as the input table, except there is a new column
% StudentName, and does not contain LastName and Firstname. .
end
%solve using Matlab, the problem has the data the function will process
Program Screen Shot:

Sample Output:

Program Code to Copy:
function table_out = ProcessiClicker(table_in)
% Inputs: table_in: table of any size with two column variables
LastName and Firstname
% Outputs: table_out: same information as the input table, except
there is a new column
% StudentName, and does not contain LastName and Firstname. .
% extract first name and last name and strip the leading and
trailing
% spaces using matlab's strtrim function
last_name = strtrim(table_in.LastName);
first_name = strtrim(table_in.FirstName);
% concatenate last_name and first_name with a comma using
matlab's strcat
% function to get full_name
for i = 1:length(last_name)
full_name{i,1} =
strcat(strcat(last_name{i},','),first_name{i});
end
% delete the columns LastName and FirstName from table_in
table_in.LastName = [];
table_in.FirstName = [];
%
% create a new table table_out
table_out = table;
% in table_out, create a column named 'StudentName' and populate
with full_name
table_out.StudentName = full_name;
% concatenate the the remaining content of table_in to
table_out
table_out = [table_out table_in];
end
------------------------------------------------------------------------------
COMMENT DOWN FOR ANY QUERY RELATED TO THIS ANSWER,
IF YOU'RE SATISFIED, GIVE A THUMBS UP
~yc~
Problem 1: Write a function ProcessiClicker to take any sized table as an input with at...
Part 2: Processing Strings (Individual work) Processing user-entered data to follow a specific format is a common task. Often this involves using string functions to manipulate a set of input strings. Create a MATLAB script named namephone.m and place these lines of code at the beginning: name = input('Enter your first and last name: ','s'); phone = input('Enter your area code and phone number: ','s'); Tasks Here are useful string functions: length, strcat, strtrim, lower, upper, strcmp, findstr, strrep As you work...
Note: Please test your output on the console and also avoid the
functions below.
We were unable to transcribe this image6. Write a function which combines two strings which are passed as 7. The trimLeft) method removes whitespace from the left end of a 8. Write a function which removes whitespace from both ends of the parameters. Mix one character from each string and return the concatenated result. function('ABC','Defg) return ADBeCfg string. Whitespace in this context is all the whitespace...
1. (10 pts) Write a function called hws_problem1 that accepts three input arguments: 1) a 3-column string matrix (say names), 2) a 4-column numeric matrix (say, numbers), and 3) a scalar threshold value (say, threshold). Note that the names matrix is the new string type that uses double quotes. The first two input arguments contain information about U.S. astronauts, where each corresponding row of the two matrices represents a single astronaut. The columns of the two matrices contain the following...
Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates to the following tables: • Employee table (project 1) create table Employee ( empNumber char(8) not null, firstName varchar(25) null, lastName varchar(25) null, ssn char(9) null, address varchar(50) null, state char(2) null, zip char(5) null, jobCode char(4) null, dateOfBirth date null, certification bit null, salary money null, constraint PK_EMP PRIMARY KEY(empNumber), constraint EMP_STATECHECK CHECK(state in ('CA','FL')) ) GO • Job table (project 1) create...
Need help with this homework, and follow the bolded text required 7.10 LAB: Data Visualization (1) Write a function, get_data_headers(), to prompt the user for a title, and column headers for a table. Return a list of three strings, and print the title, and column headers. (2 pt) Ex: Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored Ex: Enter the column 1 header: Author name You entered: Author name Enter the column...
Need help problem 9-13
C++ Homework please help
WRITE FUNCTION PROTOTYPES for the following functions. The functions are described below on page 2. (Just write the prototypes) When necessary, use the variables declared below in maino. mm 1.) showMenu m2.) getChoice 3.) calcResult m.) showResult 5.) getInfo mm.) showName 7.) calcSquare 8.) ispositive int main { USE THESE VARIABLES, when needed, to write function prototypes (#1 - #8) double num1 = 1.5; double num2 = 2.5; char choice; double result;...
In this assignment you are going to handle some basic input operations including validation and manipulation, and then some output operations to take some data and format it in a way that's presentable (i.e. readable to human eyes). Functions that you will need to use: getline(istream&, string&) This function allows you to get input for strings, including spaces. It reads characters up to a newline character (for user input, this would be when the "enter" key is pressed). The first...
- - Requirements Building upon your project 1 and project 2, the park will be a Star Wars themed park. You must design additional parts of the database and create the following SQL Script. Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates to the following tables Employee table (project 1) Job table (project 1) ProjectMain table (Project 2) ActivityMain table (Project 2) . . For each one of the table above, you...
Write a C program to compute average grades for a course. The course records are in a single file and are organized according to the following format: Each line contains a student’s first name, then one space, then the student’s last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program...
You will write the following files: mystack.h - contains the class definition for the mystack class. mystack.cpp - contains the definitions for member functions of the mystack class. inpost.cpp - contains your convert() function. inpost.h - contains the function prototype for convert() so that the main() can call it. Each of the files (with the exception of inpost.h) is described in more detail below. All header files should contain header guards to prevent them from being included multiple times in...