Solved


Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

6 years ago

Solved


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

6 years ago

Solved


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...

6 years ago

Solved


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

6 years ago

Solved


Flipping
Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...

6 years ago

Solved


sum of non-primes
The sum of the non-primes no larger than 10 is 1+4+6+8+9+10=38 Find the sum of all the positive non-prime integers that do no...

6 years ago

Solved


Vectors counting by 2
Create a vector numbers from 7 to 15 in increments of 2

6 years ago

Solved


Max of a Vector
Write a function to return the max of a vector

6 years ago

Solved


Multiply by 3
Given the variable x as your input, multiply it by three and put the result in y.

6 years ago

Solved


Is it a number?
Determine if input is numeric. If it is,output is 1; if it is not, output is 0.

6 years ago

Solved


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...

6 years ago

Solved


The sum of the numbers in the vector
eg. [1,2,3]---->SUM=6

6 years ago

Solved


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

6 years ago

Solved


Do you like your boss?
Do you like your boss? Answer can be any string! For example: Boss = 'Do you like your boss?'; Output = 'yes' or ...

6 years ago

Solved


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

6 years ago

Solved


Celsius to Kelvin
Convert Celsius degrees to Kelvin temperature.

6 years ago

Solved


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

6 years ago

Solved


Remove the air bubbles
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...

6 years ago

Solved


Back to basics 14 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of all MATLAB keywords

6 years ago

Solved


Min of a Matrix
Return the minimum value in the given matrix.

6 years ago

Solved


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

6 years ago

Solved


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

6 years ago

Solved


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

6 years ago

Solved


Rounding
Round 10.67 and make 'y' equal to that number.

6 years ago

Solved


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

6 years ago

Solved


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

6 years ago

Solved


Angle between two vectors
You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

6 years ago

Solved


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

6 years ago

Solved


Y=X
Given an input variable x, output a variable y that is equal in value to x. Example: Input x = 1 Output y is 1 Inp...

6 years ago

Solved


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

6 years ago

Load more