Solved


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

9 months ago

Solved


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

9 months ago

Solved


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

9 months ago

Solved


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

9 months ago

Solved


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

9 months ago

Solved


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

9 months ago

Solved


Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

9 months ago

Solved


Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

9 months ago

Solved


Symmetric matrix
You must create a n-by-n *symmetric* matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : ...

9 months ago

Solved


Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

9 months ago

Solved


Jack O'Lantern
If visualized correctly, the data contained in the matrix A will look like a jack-o'-lantern. Create a function that will visu...

9 months ago

Solved


3D Plots and Colorbars
Use the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and ...

9 months ago

Solved


Plot Line Specifications
Create a line plot for function cos(x) where x is a vector of linearly spaced values going from 0 to input N with an increment o...

9 months ago

Solved


Create a figure and plot data
Given two data vectors (x,y), open a new figure and plot the data. Return the figure handle.

9 months ago

Solved


Reproduce this plot!
Write a function that will take a dataset (x,y), a best fit model (model), and the upper and lower prediction bounds (lb,ub) for...

9 months ago

Solved


Plotting Practice
Plot cos(x) vs x as shown in the figure below. Include the appropriate title, x-label, and y-label. Note, it is case sensitive. ...

9 months ago

Solved


Implement a counter
Write a function that returns a function that counts the number of times it is invoked. Example: >> h = counter; >> h() ...

9 months ago

Solved


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

9 months ago

Solved


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<https://imgur...

9 months ago

Solved


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<https://i.imgur.com/jlZDHhq.png>> ...

9 months ago

Solved


Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<https://i.imgur.com/jlZDHhq.png>> Image courtesy of <http://up...

9 months ago

Solved


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

10 months ago

Solved


Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

10 months ago

Solved


Total energy

10 months ago

Solved


Potential energy calculation

10 months ago

Solved


Kinetic energy calculation

10 months ago

Solved


Laws of motion 6

10 months ago

Solved


Laws of motion 5

10 months ago

Solved


Laws of motion 4
Given the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.

10 months ago

Solved


Laws of motion 3

10 months ago

Load more