Solved


Calculate Amount of Cake Frosting
Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

ongeveer 4 jaar ago

Solved


Make roundn function
Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

bijna 5 jaar ago

Solved


Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

ongeveer 5 jaar ago

Solved


Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

ongeveer 5 jaar ago

Solved


Find MPG of Lightest Cars
The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...

ongeveer 5 jaar ago

Solved


Find the Best Hotels
Given three input variables: * |hotels| - a list of hotel names * |ratings| - their ratings in a city * |cutoff| - the rat...

ongeveer 5 jaar ago

Solved


Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. The element values ...

ongeveer 5 jaar ago

Solved


Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

ongeveer 5 jaar ago

Solved


Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

ongeveer 5 jaar ago

Solved


Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.ⅇ^(-λt)*cos(2πft)| where |A|, |λ|, and |f| ...

ongeveer 5 jaar ago

Solved


Solve a System of Linear Equations
*Example*: If a system of of linear equations in _x&#8321_ and _x&#8322_ is: 2 _x₁_ + _x₂_ = 2 _x&#83...

ongeveer 5 jaar ago

Solved


Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

ongeveer 5 jaar ago

Solved


Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

ongeveer 5 jaar ago

Solved


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

ongeveer 5 jaar ago

Solved


Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...

ongeveer 5 jaar ago

Solved


There are 10 types of people in the world
Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

ongeveer 5 jaar ago

Solved


Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

ongeveer 5 jaar ago

Solved


Basic commands - Least common multiple
Make a function which will return least common multiple of "a" and "b" Example: a=8; b=6; y=24;

ongeveer 5 jaar ago

Solved


Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
Example: in = magic(5) in = 17 24 1 8 15 23 5 7 14 16 4 6 13 20 ...

ongeveer 5 jaar ago

Solved


Put two time series onto the same time basis
Use interpolation to align two time series onto the same time vector. This is a problem that comes up in <http://www.mathwork...

meer dan 5 jaar ago

Solved


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

meer dan 5 jaar ago

Solved


ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

meer dan 5 jaar ago

Solved


Calendar Matrix
Return a calendar matrix for the given values of month and year. Assume that Sunday is the first day of the week. The resulting ...

bijna 6 jaar ago

Solved


Back to basics 20 - singleton dimensions
Covering some basic topics I haven't seen elsewhere on Cody. Remove the singleton dimensions from the input variable (e.g. if...

meer dan 7 jaar ago

Solved


Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column. Exa...

meer dan 7 jaar ago

Solved


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

meer dan 7 jaar ago

Solved


How to calculate log?
There is a log that have base 5. How to calculate? log5(x)?

meer dan 7 jaar ago

Solved


Find remainder when x is divided by 3
Find remainder when x is divided by 3

meer dan 7 jaar ago

Solved


Test if a number is numeric or not
Test if a number is numeric or not

meer dan 7 jaar ago

Solved


Rotate array 90 degrees
Rotate the given matrix by 90 degrees. Example, A = [1 2 3 ; 4 5 6 ] B = rotated(A) = [ 3 6; 2 5; 1 4 ]

meer dan 7 jaar ago

Load more