已解决


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

11 years 前

已解决


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

11 years 前

已解决


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

11 years 前

已解决


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...

11 years 前

已解决


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

11 years 前

已解决


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

11 years 前

已解决


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

11 years 前

已解决


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".

11 years 前

已解决


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

11 years 前

已解决


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

11 years 前

已解决


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

11 years 前

已解决


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

11 years 前

已解决


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

11 years 前

已解决


Add two numbers
Given a and b, return the sum a+b in c.

11 years 前

已解决


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

11 years 前

已解决


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

11 years 前

已解决


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

11 years 前

已解决


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

11 years 前

已解决


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

11 years 前

已解决


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...

11 years 前

提问


Format axes in plot
Is it possible to color a single number (or a set of numbers) on one of the axes in Matlab? Suppose I have a plot: plot(...

11 years 前 | 1 个回答 | 0

1

个回答

提问


Legend in biograph plot
I have a |biograph| object, and I want to "color-code" the edges and vertices. Is it possible to get legends in the biograph...

11 years 前 | 0 个回答 | 1

0

个回答

已回答
Mean of 2 arrays
One way would be: mean(mean([imag{1} imag{2}])) If the dimensions don't match: mean([imag{1}(:); imag{2}(:)])

11 years 前 | 1

已回答
Adding two different size matrices
You can't add matrices of different dimensions. The transpose of A has dimension (50x100) Think of it: A = [1 2 ...

11 years 前 | 0

| 已接受

提问


Speed up sparse matrix calculations
Is it possible to speed up large sparse matrix calculations by e.g. placing parantheses optimally? What I'm asking is: Can I ...

11 years 前 | 0 个回答 | 0

0

个回答

已回答
Explanation of the code
The input to |cosd| and |sind| are in degrees, whereas it is in radians for |cos| and |sin|. l = sind(alpha)*b; % the verti...

11 years 前 | 1

提问


Profiling for cells instead of functions
I have a function that in turn calls many more functions. I want to use the profiler to identify what parts of the code is most ...

11 years 前 | 1 个回答 | 1

1

个回答

提问


Finding the difference between columns in matrix without loops
I have the results from an iterative process, where the results from each iteration is placed beside eachother, like this: ...

11 years 前 | 1 个回答 | 0

1

个回答

已回答
Not enough input arguments
Use lower case m, or some other letter that can't be mixed with upper case M, as indices in your for-loops, and you'll get there...

11 years 前 | 0

已回答
Please tell me what's wrong here with the exp (1j*theta)
The reason is that: 5 rad = -1.2832 rad % (-1.2832 + 2*pi = 5) That is: x = x + n*2*pi; % where x is an angle in...

11 years 前 | 0

| 已接受

加载更多