Former product manager for MATLAB, but the company decided to trust me with the source code, so now I'm a developer.

Solved

Matrix indexing with two vectors of indices

Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

1 year ago

Solved

Getting logical indexes

This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

1 year ago

Solved

Return elements unique to either input

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

1 year ago

Solved

Set the array elements whose value is 13 to 0

Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

1 year ago

Solved

Replicate elements in vectors

Replicate each element of a row vector (with NaN) a constant number of times. Examples : n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

1 year ago

Solved

Find the largest value in the 3D matrix

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

1 year ago

Solved

Check if number exists in vector

Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

1 year ago

Answered

Why can't I mex cpp with matlab?

MEX is working as expected. How old is this code? Xcode's compiler is alerting you to several risky programming patterns bei...

Why can't I mex cpp with matlab?

MEX is working as expected. How old is this code? Xcode's compiler is alerting you to several risky programming patterns bei...

2 years ago | 1

Answered

Does anyone know how to run selection on mac?

Shift+F7. If you are on a lap, depending on your system preferences, you might need to add Fn to that chord (I do). As Jan sug...

Does anyone know how to run selection on mac?

Shift+F7. If you are on a lap, depending on your system preferences, you might need to add Fn to that chord (I do). As Jan sug...

2 years ago | 2

Answered

Why did I get this error?

The function |deg2rag| was introduced in R2015b, according to the <http://www.mathworks.com/help/matlab/ref/deg2rad.html documen...

Why did I get this error?

The function |deg2rag| was introduced in R2015b, according to the <http://www.mathworks.com/help/matlab/ref/deg2rad.html documen...

2 years ago | 0

Answered

OS X 10.5.8 install

R2010b was the last release to support OS X 10.8: <http://www.mathworks.com/support/sysreq/release2010b/macintosh.html>

OS X 10.5.8 install

R2010b was the last release to support OS X 10.8: <http://www.mathworks.com/support/sysreq/release2010b/macintosh.html>

2 years ago | 0

Answered

multiple line edit is not allowed on MATLAB file editor window?

The MATLAB Editor does not have this, I think. Do you have an example MATLAB source file you can share with us where this kind ...

multiple line edit is not allowed on MATLAB file editor window?

The MATLAB Editor does not have this, I think. Do you have an example MATLAB source file you can share with us where this kind ...

2 years ago | 0

Answered

Question on using a while loop?

To add the bet from the total, use: Bank = Bank + Bet; Subtraction will be similar, using "-" of course. To get your p...

Question on using a while loop?

To add the bet from the total, use: Bank = Bank + Bet; Subtraction will be similar, using "-" of course. To get your p...

2 years ago | 0

Answered

Does matlab become slow and unusable when working in a folder with many files?

When you cd into a folder with 50,000 file, bear in mind that *all of these files are visible from MATLAB path*, and therefore m...

Does matlab become slow and unusable when working in a folder with many files?

When you cd into a folder with 50,000 file, bear in mind that *all of these files are visible from MATLAB path*, and therefore m...

2 years ago | 1

Answered

Can anyone help me with telling me how my variable is undefined?

You are writing a function that accepts 'temperature' as an input parameter. So, 'temperature' will exist inside your functions...

Can anyone help me with telling me how my variable is undefined?

You are writing a function that accepts 'temperature' as an input parameter. So, 'temperature' will exist inside your functions...

2 years ago | 0

Answered

Applying multiple conditions to an 'if' statement

You might be looking for <http://www.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html logical operators>.

Applying multiple conditions to an 'if' statement

You might be looking for <http://www.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html logical operators>.

2 years ago | 0

Answered

Mex can't find compiler after Xcode 7 update (R2015b)

*EDIT* MathWorks has produced a patch for this issue. If at all possible, use the procedure outlined at http://www.mathworks.co...

Mex can't find compiler after Xcode 7 update (R2015b)

*EDIT* MathWorks has produced a patch for this issue. If at all possible, use the procedure outlined at http://www.mathworks.co...

2 years ago | 16

| accepted

Answered

Print out values in a while loop each time into an array.

A semicolon at the end of the line suppresses output [ <http://www.mathworks.com/help/matlab/matlab_prog/symbol-reference.html#b...

Print out values in a while loop each time into an array.

A semicolon at the end of the line suppresses output [ <http://www.mathworks.com/help/matlab/matlab_prog/symbol-reference.html#b...

3 years ago | 0

Answered

32 bit mex file not working in a 64 bit version of matlab

This is a stab in the dark, but a Google search found <https://github.com/filipjares/tdv/tree/master/src/gcs/private this on Git...

32 bit mex file not working in a 64 bit version of matlab

This is a stab in the dark, but a Google search found <https://github.com/filipjares/tdv/tree/master/src/gcs/private this on Git...

3 years ago | 2

Answered

Tranform Python code in Matlab

MATLAB is 1-indexed, so I think you're looking for something like: diff = X(pairs(:,1),:) - X(pairs(:,2),:);

Tranform Python code in Matlab

MATLAB is 1-indexed, so I think you're looking for something like: diff = X(pairs(:,1),:) - X(pairs(:,2),:);

3 years ago | 0

Answered

Read in file that has raw binary image data and an XML footer

You've got the right idea. Since you know the size of the image, open the mixed image/XML file with <http://www.mathworks.com...

Read in file that has raw binary image data and an XML footer

You've got the right idea. Since you know the size of the image, open the mixed image/XML file with <http://www.mathworks.com...

3 years ago | 0

| accepted

Answered

how to select a number randomly from a series of fixed number

>> a(randi(numel(a))) In other words, pick a random (integer) number _N_ between 1 and the number of elements in "a", then r...

how to select a number randomly from a series of fixed number

>> a(randi(numel(a))) In other words, pick a random (integer) number _N_ between 1 and the number of elements in "a", then r...

3 years ago | 0

| accepted

Answered

Why can parfor only write to one dimension?

From parfor's perspective, "result" is being accessed randomly. Try this instead: parfor i=index results1{i} = an...

Why can parfor only write to one dimension?

From parfor's perspective, "result" is being accessed randomly. Try this instead: parfor i=index results1{i} = an...

3 years ago | 0

Answered

How to do better commenting in Matlab script?

You'll get to the settings you need under "Home -> Preferences -> Editor/Debugger -> Display" and "Home -> Preferences -> Editor...

How to do better commenting in Matlab script?

You'll get to the settings you need under "Home -> Preferences -> Editor/Debugger -> Display" and "Home -> Preferences -> Editor...

3 years ago | 0

Answered

Generating a mex file from .m file

It looks like your system does not have the GNU C++ standard library installed. I believe this can be the case in some down dis...

Generating a mex file from .m file

It looks like your system does not have the GNU C++ standard library installed. I believe this can be the case in some down dis...

3 years ago | 0

Answered

How can I setup MATLAB to differentiate things like recent directories and command histories for two unrelated projects?

I don't think there is direct support for like this you describe. Path management can be semi-automated with scripts, but comma...

How can I setup MATLAB to differentiate things like recent directories and command histories for two unrelated projects?

I don't think there is direct support for like this you describe. Path management can be semi-automated with scripts, but comma...

3 years ago | 0

| accepted

Answered

Bug in matlab 2013b: all windows resize (get very small) when I right click in the Editor. It returns to normal only when program is restarted.

See <http://www.mathworks.com/matlabcentral/answers/122347-matlab-editor-windows-and-fonts-resize-get-smaller-on-right-click-why...

Bug in matlab 2013b: all windows resize (get very small) when I right click in the Editor. It returns to normal only when program is restarted.

See <http://www.mathworks.com/matlabcentral/answers/122347-matlab-editor-windows-and-fonts-resize-get-smaller-on-right-click-why...

3 years ago | 0

Answered

Why Matlab window gets smaller pressing right mouse button?

See <http://www.mathworks.com/matlabcentral/answers/122347-matlab-editor-windows-and-fonts-resize-get-smaller-on-right-click-why...

Why Matlab window gets smaller pressing right mouse button?

See <http://www.mathworks.com/matlabcentral/answers/122347-matlab-editor-windows-and-fonts-resize-get-smaller-on-right-click-why...

3 years ago | 0

Answered

parallel computing speed question when the body of the parfor loop takes about 2 seconds

It really depends on what "dosomething" is doing. If it is pure computation, it should be a big win. If there is file or netwo...

parallel computing speed question when the body of the parfor loop takes about 2 seconds

It really depends on what "dosomething" is doing. If it is pure computation, it should be a big win. If there is file or netwo...

3 years ago | 0

| accepted

Answered

How to selectively import a column from a text file containing lot of headers

You can import all 57 columns with the following: txt=fileread('1.TXT'); % Read 57 numeric columns of data textscan(txt,...

How to selectively import a column from a text file containing lot of headers

You can import all 57 columns with the following: txt=fileread('1.TXT'); % Read 57 numeric columns of data textscan(txt,...

3 years ago | 1

| accepted