Resistance of a light bulb
The current through two identical light bulbs connected in series is C Amperes. The total voltage across both bulbs is V Volts....
4年弱 前
解決済み
Calculate Parallel Resistance
Three resistors connected in parallel have resistances R1, R 2, and R 3, respectively. Return the total resistance R total of ...
4年弱 前
解決済み
Vector Magnitude Calculator
'a' is a vector that starts at the origin and ends at (x, y). Find ||a||.
Hint: It is as simple as "ABC".
4年弱 前
解決済み
union without repitition
Let
a = [9 9 9 9 9 9 8 8 8 8 7 7 7 6 6 6 5 5 4 2 1]
b = [1 1 1 3 3 3 3 3 4 4 4 4 4 10 10 10]
Output should be
[9 8...
4年弱 前
解決済み
Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody.
Return as a string the name of the input variable to the functio...
4年弱 前
解決済み
vectors counting by 5
Create a vector with numbers from x_min to x_max in increments of 5.
4年弱 前
解決済み
intervals
Write a function that takes an interval from a to b, and divides it into 6 parts.
4年弱 前
解決済み
row removal
Remove the nth row from input matrix M and return the resulting matrix in output N.
4年弱 前
解決済み
Determine given vector is even or odd
Find the numbers of the input vector is odd or even then replace even with 1 and odd with 0
Example
x = [ 3 3 4 6 1]
...
4年弱 前
解決済み
count any radix?
given radix r(2-9), digts d(1-4), give all possible strings in sorted order. for example, if r=2, d=2, then output {'00' '01' '1...
4年弱 前
解決済み
Decimal Comparison
*Background*
A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...
Diagonal of a Spiral Matrix
Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...
Spot the rectangle (Part 2)
This problem is related to the 17x17 challenge. See also Part 1 of this problem. Given a matrix in which each element is either ...
4年弱 前
解決済み
Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...
Number of divisors of a given number
Given a Number n, return the number of his divisors without listing them
example:
n=14
; Divisors={1,7,2,14} ; y=4
n=...
4年弱 前
解決済み
Odd elimination
Inspired by Project Euler problem #539
You'll be given a vector from 1 to n;
Going from left to right, remove the first n...
4年弱 前
解決済み
How many rectangles in a grid ?
How many rectangles are there in an m × n grid ?
For example, if m=1 & n=2, we have 3 rectangles.
4年弱 前
解決済み
Matrix diagonalization
You will be given Two matrices A and B.
Return 1 if B is the diagonal matrix of A, 0 otherwise
4年弱 前
解決済み
rectangle in circle
In the figure below, the rectangle at the corner measures a cm x b cm. What is the radius of the circle in cm?
<<http://www....
4年弱 前
解決済み
Slicing the cube
A bored matlab enthusiast has a cube with volume n^3.
He decides to paint the entire surface of the cube red. Then, with slices...
4年弱 前
解決済み
Whole Number Un-Concatenator
Write a function that accepts an integer and an index digit and returns a vector containing two integers which are the leading a...