An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:*
Many important observations in math and science can be described by short, but powerful, equations...
Simple polynomial evaluation
Compute the value of a polynomial of degree n with all coefficients '1', at value x. n is always n>=0.
p(x)=1+x+x^2+...+x^n...
Create logarithmically spaced values (★)
Given three numbers a,b,n with b>a, create a vector y with n logarithmic spaced values between 10^a and 10^b.
Thus, if a = -2, ...
Sum of elements in a vector (★)
(copy of Prob. 3)
Find the sum of all the numbers of the input vector x.
Input x = [1 2 3 5]
Output y is 11
<>
...
5年弱 前
解決済み
Find the minimal value in N*N Matrix
Suppose that we have N by N matrix, we try to find the minimal value in that matrix.
examples:
Input A=[1 2 3 5 6;52 58 56 45...
5年弱 前
解決済み
Add a vector to a matrix
Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...
5年弱 前
解決済み
Remove the air bubbles from a vector
_*A reduced version of Problem 112*_
Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...
5年弱 前
解決済み
Tax Calculator
Calculate the tax for a given income.
10% tax is paid for any income up to $2,000.
20% tax is paid for additional income u...
5年弱 前
解決済み
Area of a Square
Given the length x of the side of a regular square, find the area of the square, A.
5年弱 前
解決済み
Eye Squared
For a positive integer |n| create the identity matrix with |n| elements.
In case it is not possible to produce an identity ma...
The 5th Root
Write a function to find the 5th root of a number.
It sounds easy, but the typical functions are not allowed (see the test su...
5年弱 前
解決済み
Sudoku square
We have a small Sudoku square, but one number is missing.
x = [ 1 5 4
8 6 3
0 9 7 ]
Make a function, wher...
5年弱 前
解決済み
Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.
5年弱 前
解決済み
Sum of adjacent elements in a vector
Given a vector v, return a vector s containting the sum of every two adjacent elements in the vector.
Every element s(i) cont...