Community Profile

# Patrick Mineault

### McGill University

49 total contributions since 2010

http://xcorr.net
Professional Interests: neuroscience

Contributions in
View by

Submitted

mexme - write MEX files in no time
writes fully valid MEX .cpp files including mexFunction boilerplate based on numeric C/C++ snippet

Solved

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

5 years ago

Solved

Is my wife right?
Regardless of input, output the string 'yes'.

5 years ago

Solved

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

5 years ago

Solved

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

5 years ago

Solved

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

5 years ago

Submitted

Fits GLM with a quadratic penalty, determines hyperparams through cross-validation or evidence

Submitted

Auto Gaussian & Gabor fits
Fit 1D/2D Gaussian or Gabor to a curve/surface without start guesses for params

Submitted

Matching pursuit for 1D signals
Performs Matching Pursuit on 1d (temporal) signals with custom basis

Submitted

Fast B-spline class
Fit, evaluate, differentiate non-uniform B-splines of any order - fast

Submitted

Boosted Generalized Additive Models (bgam) package
Boosting for the Generalized Additive and Linear Models (GAM and GLM).

Submitted

Unique elements in cell array
unique for numeric cell arrays. If c = {[0],[1,2],[0],[8],[1,2]} returns {[0],[1,2],[8]}

Responded

Re: Multithreading in Mex file for embarassingly parallel problem
Yes, sorry, I culled some irrelevant details from my actual code and the code I posted doesn't make sense, in fact "potentialres...

6 years ago | 5693 views

Responded

Re: Multithreading in Mex file for embarassingly parallel problem
That seems like a reasonable workaround. I have one lingering question about the internals of OMP. When I write shared(r,R), it ...

6 years ago | 5693 views

Responded

Re: Multithreading in Mex file for embarassingly parallel problem
For myself and I think most Matlab users, 99% of the time, "the user" and "the programmer" are the same person. In that case it ...

6 years ago | 5693 views

Responded

Re: Multithreading in Mex file for embarassingly parallel problem
There's really not a lot of potential savings in migrating the .m code to C. I used the profiler and about 95% of the time was b...

6 years ago | 5693 views

Responded

Re: Multithreading in Mex file for embarassingly parallel problem
The results of calling the mex file are used to change the value of the "r" variable, which is then used the next time the mex f...

6 years ago | 5693 views

Responded

Re: Multithreading in Mex file for embarassingly parallel problem
I tried to follow your advice regarding OpenMP and added this line on top of the outer for loop: #pragma omp parallel for share...

6 years ago | 5693 views

Responded

Re: Multithreading in Mex file for embarassingly parallel problem
My main dev platform is Ubuntu 64 bit, and I compile with gcc 4.4, which I believe supports openMP The R matrix is as large as...

6 years ago | 5693 views

Posted

Multithreading in Mex file for embarassingly parallel problem
A question for MEX gurus. I have written a MEX file that performs a certain complex computation, but whose core is equivalent to...

6 years ago | 5693 views

Responded

Re: Real time communication between two matlabs running on Windows
Interesting. The DAQ demo in the TCP/UDP/IP toolbox (http:// www.mathworks.com/matlabcentral/fileexchange/345-tcpudpip-toolbox-2...

6 years ago | 10878 views

Responded

Re: Real time communication between two matlabs running on Windows
Unfortunately the Mac doesn't have a serial port and it seems from a quick Google search it is not straightforward to get a USB ...

6 years ago | 10878 views

Responded

Re: Real time communication between two matlabs running on Windows
Unfortunately ActiveX is a Microsoft technology which means it can't be used on the Mac computer.

6 years ago | 10878 views

Posted

Real time communication between two matlabs running on Windows and Mac
We have a Mac which is used for presenting visual stimuli through Matlab, and another machine running Windows that records physi...

6 years ago | 10878 views

Responded

Re: Orientation of an animal's head
On Sep 2, 4:52 pm, "Thomas Hippocampus" One possibility is to first fit a skeleton to the shape. Then finding the head and its ...

6 years ago | 2438 views

Responded

Re: set colorbar range
Instead of displaying the colorbar using the colorbar function, you could always display it using image(currentMap). Patrick O...

6 years ago | 3271 views

Responded

Re: Launching non-blocking MATLAB scripts on a linux server from
Maybe try wrapping the command in a batch file and then calling that batch file? Something like: system('asynclinux.bat &') O...

6 years ago | 3571 views

Responded

Re: fminsearch() - Kalman Filter
If your objective function is differentiable, then you should definitely use fminunc over fminsearch. The algorithm that fminsea...

6 years ago | 1852 views

Responded

Re: Selection variables Stepwise Regression MATLAB
On Sep 1, 8:21 am, PedroLatorreCarmona <platorrecarmo...@gmail.com> This may not be a bug. A p value of 0 would indicate numeri...

6 years ago | 3105 views

Responded

Re: MEXcode for matrix manipulation (FEM Assembly) takes longer to run than mcode
Try replacing the array copy stuff at the end with a call to mxDuplicateArray

6 years ago | 2390 views