Solve a programming problem, MATLAB Programming

Assignment Help:

Write a function rid_multiple_blanks that will receive a string as an input argument. The string contains a sentence that may have multiple blank spaces in between some of the words. The function will return the string with only one blank in between words. For example,

>> mystr = 'Hello and how are you?';
>> rid_multiple_blanks(mystr)
ans =
Hello and how are you?

Save the function in a Matlab ".m" file and test it with several different input strings in the command window.

In this question we will practice using Matlab structures. In your script, which should be called ‘yourname_lab5_2.m', you need to create a vector of structures to represent some student quiz data.

Quiz data for a class is stored in a file called ‘studentinfo.dat'. Each line in the file has the student ID number (which is an integer) followed by the quiz scores for that student. For example, if there are four students and three quizzes for each, the file might look like this:

44 7 7.5 8
33 5.5 6 6.5
37 8 8 8
24 6 7 8

In the script load the data into a vector of structures. Each structure represents one student and has two fields: ‘id-no' for the integer student ID number and ‘quiz' as a vector of quiz scores. Graphically the structure will look like this:

To accomplish this, first use the load function to read all information from the file into a matrix. Then, using a loop, copy the data into a vector of structures as specified previously. Then, the script will calculate and print the quiz average for each student; for example, if the file is as just shown:

Student Quiz Ave

44 7.50
33 6.00
37 8.00
24 7.00

3. Start and Stop Codon

In nature the translation from the mRNA to the protein sequence always begins at a start codon (AUG) and ends at one of the stop codon (UAA, UGA and UAG) . Nucleotide bases before the start codon are not translated. In this question, we want to remove the bases before the first start codon in an mRNA sequence and translate the remaining bases into a protein sequence.

a) Create a function called remove_to_start that takes as input a string and returns a new string with everything prior to the first start codon removed.

For example:
>> s1 = 'AAACCCAUGCCCUAA'
>> s1_trim = remove _to_start(s1)

s1_trim =
AUGCCCUAA


Related Discussions:- Solve a programming problem

Variable number of input arguments - function, Variable number of input arg...

Variable number of input arguments: For illustration, the below function areafori has a variable number of input arguments, either the 1 or 2. The name of the function stands

Crank-nicolson method, clear tic L=1; T=0.2; nust=2000; dt=T...

clear tic L=1; T=0.2; nust=2000; dt=T/nust; n=40; dx=L/n;   r=1;  omega=10:10:5000;%Store Range of Frequencies for Simulation u=zeros(n+1,nust+1);%

Null basis and range basis, You will write functions • B=null basis(A,tol);...

You will write functions • B=null basis(A,tol); • B=range basis(A,tol); The function null basis takes a matrix A as input, and outputs a basis for the null space of A, obtained via

Function with float and integer, hi i have this programm function [IRN,num...

hi i have this programm function [IRN,number ] = randnumbers( IRN ) IRN=int32(IRN) ITOTAL=(IRN*330)+100 ITOTAL=int32(ITOTAL); IQUOTIENT=ITOTAL/2303 IQUOTIENT=int32(IQUOTIENT);

Determine two sided confidence intervals of the mean speed, The average spe...

The average speed of vehicles on a freeway is being studied. Assume that the standard deviation of vehicle speed is known to be 8 km/h. (a) Suppose observations on 120 vehicles

Plot the input and the output of the filter on a single plot, An FIR filter...

An FIR filter has coefficients b = [ 1.0000   -0.6387    1.0214    0.8210   -0.7470    1.0920 ] (a) Find H(z) for the filter and plot its frequency response (magnitude and phase

Programming concept, The Programming Concept: In most of the programmi...

The Programming Concept: In most of the programming languages, random function returns a real number; therefore the real number would then have to be rounded to produce a rand

Illustration of a conditional loop, Illustration of a conditional loop - Wh...

Illustration of a conditional loop - While loop: As an illustration of a conditional loop, we will write a function which will find the first factorial which is greater than t

Excel, Ask question Excel Ch 1.A-Grader Project-Training Workshops 1.5#Mini...

Ask question Excel Ch 1.A-Grader Project-Training Workshops 1.5#Minimum 100 words accepted#

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd