문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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

거의 11년 전

문제를 풀었습니다


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

거의 11년 전

문제를 풀었습니다


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

거의 11년 전

문제를 풀었습니다


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

거의 11년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

질문


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년 전 | 답변 수: 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년 전 | 답변 수: 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년 전 | 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년 전 | 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년 전 | 답변 수: 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년 전 | 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년 전 | 답변 수: 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년 전 | 답변 수: 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년 전 | 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년 전 | 0

| 수락됨

더 보기