Another colon problem
This is simple problem based on problems 555, 801, 1118, etc.
Create an index vector from two input vectors.
Example:
...
約9年 前
解決済み
Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.]
Non-scor...
約9年 前
解決済み
Colon operator of two vectors
You are given two vectors of equal length: VecStart, VecEnd
Each vector contain a set of integers, where VecEnd(j)>=VecStar...
約9年 前
解決済み
counting groups!
This problem is about counting groups.
Example
If you have x:
x = [0.8 0.8 0.8 0.3 0.3 0.4 0.5 0.6 0.6 0.9]
then a...
約9年 前
解決済み
Volume of a Simplex
Return the volume of a <http://en.wikipedia.org/wiki/Simplex regular _n_-simplex> with a unit side length.
Results are up to...
約9年 前
解決済み
Dots in a Circle
Return how many integer grid points there are inside a circle of radius _r_ centred at (0,0) (including points on the edge).
...
約9年 前
解決済み
Time Expansion
How can you slow down any discrete-time signal?
Example
Input original signal x.
x = [1 2 3 -1 -2 -5 -4]
We want t...
約9年 前
解決済み
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...
約9年 前
解決済み
Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN;
output -> matrix(p*m), the same matrix where we deleted the enti...
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input matrix, generate an output matrix that consists o...
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
約9年 前
解決済み
Times 2 - START HERE
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Examples:...
約9年 前
解決済み
Nth roots of unity
First, find the n nth roots of unity.
eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.
<https://en.wiki...