Community Profile

Professional Interests: General M-file coding

Contact

Top 5% contributor

Converts a fractional value to binary and vice versa

62 downloads

3 years ago

Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

Solve this!

2 years ago

You have a phenomenon that produces strictly positive or negative results. delta = [1 -3 4 2 -1 6 -2 -7]; Marching thr...

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

Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

Given an array of positive, non-zero, integers, return a cell array of strings the same size as the input, where each element in...

Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] ...

Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

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=[1...

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

You are given a vector of size 9, x = [x1 x2 x3 x4 x5 x6 x7 x8 x9] Elements of x may be randomly selected without repeati...

Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

Regardless of input, output the string 'yes'.

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

Load more