Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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]

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Resuelto


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

más de 11 años hace

Pregunta


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

más de 11 años hace | 1 respuesta | 0

1

respuesta

Pregunta


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

más de 11 años hace | 0 respuestas | 1

0

respuestas

Respondida
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}(:)])

más de 11 años hace | 1

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

más de 11 años hace | 0

| aceptada

Pregunta


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

más de 11 años hace | 0 respuestas | 0

0

respuestas

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

más de 11 años hace | 1

Pregunta


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

más de 11 años hace | 1 respuesta | 1

1

respuesta

Pregunta


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

más de 11 años hace | 1 respuesta | 0

1

respuesta

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

más de 11 años hace | 0

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

más de 11 años hace | 0

| aceptada

Cargar más