Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input vector, output true or false whether it is a colu...
3年弱 前
解決済み
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have
a = [1 2 2 2 1 ...
Sum of series I
What is the sum of the following sequence:
Σ(2k-1) for k=1...n
for different n?
3年弱 前
解決済み
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
3年弱 前
解決済み
Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
3年弱 前
解決済み
Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.
3年弱 前
解決済み
Energy of a photon
⚛ ☢ ⚛ ☢ ⚛ ☢ ⚛
Given the frequency F of a photon in giga hertz.
Find energy E of this photon...
The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
3年弱 前
解決済み
Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x.
<<https://i.imgur.com/jlZDHhq.png>>
Image courtesy of <http://up...
Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...