Community Profile

photo

Duncan Po


MathWorks

84 total contributions since 2013

Contact

Duncan Po's Badges

  • Knowledgeable Level 2
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
Help with creating histogram
If you convert to categorical, you can sort the counts by descending order: a = randi(10,10,10); histogram(categorical(a), 'Di...

etwa ein Monat ago | 0

| accepted

Answered
Is there a way to plot multiple graphs in one "subplot" of a stackedplot figure?
stackedplot can plot multiple lines in the same axes. One way is to have a non-column matrix as one of your table variables: x ...

2 Monate ago | 1

| accepted

Answered
I can't plot two lists as histograms as different colors on the same plot. Hist wants 'Numeric Input'
What does class(list1) return? If it returns anything other than a builtin numeric class, that would be the reason for your erro...

mehr als ein Jahr ago | 0

Answered
arrange multiple 2D histograms in 3D
You can use the hist function to plot one histogram, then grab its vertices from the resulting patch object. Pass these vertices...

fast 3 Jahre ago | 0

Answered
how to extract subbands from pyramidal directional filter bank/contourlet decomposition of an image?
You need the contourlet toolbox: <http://www.mathworks.com/matlabcentral/fileexchange/8837-contourlet-toolbox>

fast 3 Jahre ago | 0

Answered
Two bar graphs - two data sets - different bin width
histogram/histcounts have builtin support for Freedman-Diaconis rule: histogram(x, 'BinMethod', 'fd') or [n, binedges] ...

fast 3 Jahre ago | 0

Answered
When brushing 3-d scatter, why does the marker not change?
Are you using R2014b? There is a bug in that version. Good news is it is fixed in 15a, so if you update, brushing on scatter3 wi...

fast 3 Jahre ago | 1

| accepted

Answered
How to do sliding window operation in Matlab?
R2016a has a new function movsum: >> x=[4,1,1,1,2,2,3,5,9,7,7,7,6,6,1,1,2,3,4,4] >> movsum(x,10,'EndPoints','discard') ...

etwa 3 Jahre ago | 2

Answered
Splitapply, each data of group in a new figure/plot
You can do it but not with an anonymous function. You need a separate function to pass into splitapply: function myplot(dm,...

etwa 3 Jahre ago | 0

| accepted

Answered
Count numbers for occurrences
If you are using R2015b or later versions, you can use findgroups and splitapply: % Set up a table with pretend data use...

etwa 3 Jahre ago | 2

Solved


Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

etwa 6 Jahre ago

Solved


Find the largest value in the 3D matrix
Given a 3D matrix, A, find the largest value. E.g. >> A = 1:9; >> A=reshape(A,[3 1 3]); >> islargest(A) ans = 9

etwa 6 Jahre ago

Solved


Back to basics 10 - Max Float
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

etwa 6 Jahre ago

Solved


Subset Sum
Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. I...

etwa 6 Jahre ago

Solved


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

etwa 6 Jahre ago

Solved


Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

etwa 6 Jahre ago

Solved


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

etwa 6 Jahre ago

Solved


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

etwa 6 Jahre ago

Solved


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

etwa 6 Jahre ago

Solved


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

etwa 6 Jahre ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

etwa 6 Jahre ago

Solved


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

etwa 6 Jahre ago

Solved


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

etwa 6 Jahre ago

Solved


Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

etwa 6 Jahre ago

Solved


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

etwa 6 Jahre ago

Solved


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

mehr als 6 Jahre ago

Solved


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

mehr als 6 Jahre ago

Solved


Least common multiple of many numbers
1:6 -> 60

mehr als 6 Jahre ago

Solved


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

mehr als 6 Jahre ago

Solved


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

mehr als 6 Jahre ago

Load more