Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

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

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M9528230

Have any Question?


Related Questions in MATLAB

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

Suppose that you have used some concept learning algorithm

Suppose that you have used some concept learning algorithm to learn a hypothesis h1 from some training data. You are interested in knowing the accuracy that the hypothesis can be expected to achieve on the underlying pop ...

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

Suppose that a student has the option of enrolling for a

Suppose that a student has the option of enrolling for a single elective during a term. The student must select a course from a limited list of options: "English, " "History, " "Biology, " "Computer, " or "Math." Constru ...

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Recitation problems -1 determine the highest real root of

Recitation Problems - 1. Determine the highest real root of f(x) = 2x 3 - 11.7x 2 + 17.7x - 5 using the Newton-Raphson method with at least four iterations. Start with an initial guess of x 0 = 3. 2. Determine the real r ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As