Package deal
5 Matlab Cody Problems Vol 4
Problems 15 , 76 , 48 , 74 and 147 with full functional code . Just copy and paste to the provided links and complete the problems mentioned above!
[Show more]Problems 15 , 76 , 48 , 74 and 147 with full functional code . Just copy and paste to the provided links and complete the problems mentioned above!
[Show more]Problem 147. Too mean-spirited
Created by the cyclist in Community 
Find the mean of each consecutive pair of numbers in the input row vector. For example,
x=[1 2 3] ----> y = [1.5 2.5]
x=[100 0 0 0 100] ----> y = [50 0 0 50]

Preview 1 out of 2 pages
Add to cartProblem 147. Too mean-spirited
Created by the cyclist in Community 
Find the mean of each consecutive pair of numbers in the input row vector. For example,
x=[1 2 3] ----> y = [1.5 2.5]
x=[100 0 0 0 100] ----> y = [50 0 0 50]

Problem 74. Balanced number
Created by Cody Team in Cody Challenge 
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to the second half.
Examples:
 Input n = 13722 
 Output tf is true
because 1 3 = 2 2.
 Input n = 235...
Preview 1 out of 2 pages
Add to cartProblem 74. Balanced number
Created by Cody Team in Cody Challenge 
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to the second half.
Examples:
 Input n = 13722 
 Output tf is true
because 1 3 = 2 2.
 Input n = 235...
Problem 48. Making change
Created by Cody Team in Cody Challenge 
Given an amount of currency, return a vector of this form:
 [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01]
Example:
 Input a = 257.68
 Output b is [2 1 0 0 1 1 0 1 0 1 1 3]
Always use bigger bills/coins if possible.

Preview 1 out of 2 pages
Add to cartProblem 48. Making change
Created by Cody Team in Cody Challenge 
Given an amount of currency, return a vector of this form:
 [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01]
Example:
 Input a = 257.68
 Output b is [2 1 0 0 1 1 0 1 0 1 1 3]
Always use bigger bills/coins if possible.

Problem 76. De-dupe
Created by Cody Team in Cody Challenge 
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
 a = [5 3 6 4 7 7 3 5 9]
then
 dedupe(a) = [5 3 6 4 7 9]

Preview 1 out of 2 pages
Add to cartProblem 76. De-dupe
Created by Cody Team in Cody Challenge 
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
 a = [5 3 6 4 7 7 3 5 9]
then
 dedupe(a) = [5 3 6 4 7 9]

Problem 15. Find the longest sequence of 1's in a binary sequence.
Created by Cody Team in Cody Challenge 
Given a string such as
 s = '011110010000000100010111'
find the length of the longest string of consecutive 1's. In this example, the answer would be 4.
Example:
 Input x = '110100111'
 ...
Preview 1 out of 2 pages
Add to cartProblem 15. Find the longest sequence of 1's in a binary sequence.
Created by Cody Team in Cody Challenge 
Given a string such as
 s = '011110010000000100010111'
find the length of the longest string of consecutive 1's. In this example, the answer would be 4.
Example:
 Input x = '110100111'
 ...
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Stuvia is a marketplace, so you are not buying this document from us, but from seller nick1982. Stuvia facilitates payment to the seller.
No, you only buy these notes for $25.49. You're not tied to anything after your purchase.
4.6 stars on Google & Trustpilot (+1000 reviews)
93705 documents were sold in the last 30 days
Founded in 2010, the go-to place to buy study notes for 14 years now