Solved


Test if a Number is a Palindrome without using any String Operations
*Description* Given an integer _X_, determine if it is a palindrome number. That is, _X_ is equal to the _X_ with the digits ...

meer dan 10 jaar 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...

meer dan 10 jaar ago

Solved


Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
The given function returns the index of the maximum value in a given matrix. such as X=[4,3,4,5,9,12,0,5] Ans= 6 if maxim...

meer dan 10 jaar ago

Solved


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

meer dan 10 jaar ago

Solved


Tricky timing
Write a function that takes between 0.5 seconds and 0.6 seconds to run.

meer dan 10 jaar ago

Solved


Find the hypotenuse
Given a and b (the two sides of a right-triangle), find c, the hypotenuse.

meer dan 10 jaar ago

Solved


Fahrenheit to Celsius converter
Convert Fahrenheit to Celsius degrees.

meer dan 10 jaar ago

Solved


01 - Scalar variables
Create the following variables: <<http://samle.dk/STTBDP/Assignment1_1.png>>

meer dan 10 jaar ago

Solved


Negative matrix
Change the sign of all elements in given matrix.

meer dan 10 jaar 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)) ...

meer dan 10 jaar ago

Solved


Find the nearest integer
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...

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


Find the "ordinary" or Euclidean distance between A and Z
A, B and Z define three points in the 3D _Euclidean_ space of the form: A = [x1;y1;0]; B = [x2;y2;0]; Z = [x2;y2;z]; Find th...

meer dan 10 jaar ago

Solved


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

meer dan 10 jaar ago

Solved


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

meer dan 10 jaar ago

Solved


Make an N-dimensional Multiplication Table
*INSTRUCTIONS* This is a multi-dimensional variant of the normal multiplication table used to teach elementary students multi...

meer dan 10 jaar ago

Solved


Back to basics 18 - justification
Covering some basic topics I haven't seen elsewhere on Cody. Given a string with extra spaces in front and/or in back, return...

meer dan 10 jaar ago

Solved


03 - Matrix Variables 1
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3a.png>> A 9x9 matrix full of 2's (Hint: use *ones* o...

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar 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 ...

meer dan 10 jaar ago

Solved


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

meer dan 10 jaar ago

Solved


N-Cards Problem
You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

meer dan 10 jaar ago

Solved


Celsius to Fahrenheit converter
Convert Celsius to Fahrenheit degrees.

meer dan 10 jaar ago

Solved


Back to basics 2 - Function Path
Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

meer dan 10 jaar ago

Solved


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.

meer dan 10 jaar ago

Solved


Is the paranthesis sequence balanced ?
Quantum mechanics and computer science are interested in <http://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation bra-kets>. Today...

meer dan 10 jaar ago

Solved


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

meer dan 10 jaar ago

Solved


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

meer dan 10 jaar ago

Solved


Remove white space from the string
Remove the white spaces (trailing and leading) from the input variable

meer dan 10 jaar ago

Solved


Will there be a new leader?
Simply answer the title.

meer dan 10 jaar ago

Load more