Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example:
[q,r] = swap(5,10)
returns q = ...
4年弱 前
解決済み
matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below.
...
Draw the symbol '+'
Draw '+' in an x-by-x matrix (where x is odd and x >3)
Example:
x = 5
y = [0 0 1 0 0
0 0 1 0 0
1 1 1 1 1
0 ...
4年弱 前
解決済み
Total resistance of resistors in series
What is the total resistance of a number of resistors in series?
A vector R contains the resistances (in Ohm) of n resistors, w...
4年弱 前
解決済み
Total resistance of resistors in parallel
What is the total resistance of a number of resistors in parallel?
A vector R contains the resistances (in Ohm) of n resistors,...
Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...
4年弱 前
解決済み
Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58.
A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...
4年弱 前
解決済み
Circumscribed circles
Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle.
Example:
[3 4 5] -> 2.5
4年弱 前
解決済み
Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...