Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example start with x = 1 and y = 3 end with y = 1 and x = 3 Do NOT simply r...

Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
Submit your answer to this problem a multiple of 5 seconds after the hour. Your answer is irrelevant; the only thing that matte...

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

Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

calculate the tangent of angle in radians
Calculate the tangent of angle in degrees

Counting down
Create a vector that counts from 450 to 200 in increments of 10.

Speed of car
Calculate the Speed of car given its Distance travelled and time taken in x and y respectively

Create a square matrix of zeros of even order
Create a square matrix of zeros of even order

Find out total non zero element of matrix
Find out Non zero element of matrix A=magic(5) 17 24 1 8 15 23 5 7 14 16 4 6...

Rotate Matrix @180 degree
Rotate Matrix @180 degree Example A=[8 1 6; 3 5 7; 4 9 2], then answer would be [2 9 4;...

Find the mode of the given input
Find the statistical <http://en.wikipedia.org/wiki/Mode_(statistics)/ mode> of the given input. Example: If X is matr...

Element by element multiplication of two vectors
Given two input vectors, return the element-by-element product. Example A = [1 2 3] B = [7 3 1] The answer should be...

Find out magnitude of vector
Find out magnitude of vector. Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2) Please don't use sum function. If you l...

Matlab Basics II - Max & Index of Max
Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

Weave two vectors into one
Weave the two given vectors into one as shown below. Example: If a = [1 1 1] b = [0 0 0] then y = [1 0 1 0 ...

Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix Grades=[98 56 34 100 88 87] **re...

find the roots of a quadratic equation
for e.g x = [ 2 -1 -3] y = [1.5 -1]

factorial of a number x
Factorial of a number x

Calculate square and cube of number
Calculate square and cube of number x

Temperature conversion
Convert temperature in degrees Celsius (C) to temperature in degrees Kelvin (K). Assume your answer is rounded to the nearest Ke...

Generalised Hamming Number
Inspired by Project Euler n°204 and Problem 1308 by James A generalised Hamming number of type n, has no prime factor larger ...

Find vampire numbers
A <http://en.wikipedia.org/wiki/Vampire_number vampire number> is a number v that is the product of two numbers x and y such th...