Answered
Simpler way without for loops
I would just keep the |for|-loops. Alternatively, you could use |sub2ind| to build a linear index from the pieces and then ...

11 years ago | 1

| accepted

Answered
Sketetonize 3D stack of binary images
It is rather difficult to skeletonize in 3d. I remember looking for this in grad school and never found anything. However, thi...

11 years ago | 0

| accepted

Answered
How to avoid syms in Simulink
Since you're not generating code from it, you could use the "Interpretted MATLAB Function Block" which should allow for the use ...

11 years ago | 0

Answered
Can you fold a highlighted selection of code?
I think the bigger question is why do you have more than 1000 lines in a file? Consider breaking it out into smaller managea...

11 years ago | 0

Answered
dicarding the mth binary digit
A(:,2:end)

11 years ago | 0

| accepted

Answered
How to pass function arguments to publish.m?
The string will be |eval|-ed so pass it in to publish telling it where to find _x_. For example: x = magic(10); publish f...

11 years ago | 0

Answered
What is the correct syntax for num2str
First, |set| is a very important MATLAB function so I would advise against shadowing it with a variable. You would need to co...

11 years ago | 0

Answered
Finding the number of integers in a vector
nnz(v==round(v) & v>0)

11 years ago | 0

| accepted

Answered
Any advice on making a poker game?
Build on the cyclist's idea, I would identify card numbers from 1:52 based on |mod(card,13)| mod(1:52,13) This will save...

11 years ago | 0

Answered
how to capture certain area of screen
No reason to reinvent the wheel. <http://www.mathworks.com/matlabcentral/fileexchange/24323-screencapture-get-a-screen-captur...

11 years ago | 0

Answered
()-indexing must appear last in an index expression.
MATLAB does not support cascaded indexing. You'll need to either create a new variable and index into it or use an anonymous fu...

11 years ago | 0

Answered
GUI Data Acquisition Backwards
Put a break point on that line throwing the error and stop to see what's happening, what is HeadRight? Where did it come from? ...

11 years ago | 0

Answered
How to fix Cell contents assignment to a non-cell array object ERROR?
Filename must exist as something else (non-cellular) beforehand. It works fine for me: clearvars for i=1:10 file...

11 years ago | 5

Answered
ismember for string matrix
You need to make A and B cell arrays so that each string piece is a separate element (rather than a 1xn string. The fix is simp...

11 years ago | 0

Answered
Read out intensites and corresponding X,Y,Z-coordinates from a 3D-image
load mri D = squeeze(D); idx = logical(D); % Where in D is nonzero? vals = D(idx); % extract values ind = find(idx); %...

11 years ago | 0

Answered
how to exit the occupy of the license of a matlab toolbox?
Restart MATLAB.

11 years ago | 0

| accepted

Answered
Naive Bayes Classification for categorical values
Convert the categoricals to doubles. c = categorical({'red';'blue';'red'}) double(c)

11 years ago | 0

| accepted

Answered
matrix divide in an array or 2d matrix.
You can do the whole divide at once, using n instead of 10000 to avoid killing my laptop: mat2 = reshape(mat,n^2,15); nm2 ...

11 years ago | 0

| accepted

Answered
does nonlcon works for gamultiobjective Matlab r2014a
The ability for |gamultiobj| to support nonlinear constraints was added in R2014b. <http://www.mathworks.com/help/releases/R2...

11 years ago | 0

Answered
Where shall I put my "toolbox" my company provides for MATLAB?
You can put them anywhere and then just add them to the MATLAB path ( |addpath/pathtool| ). I would advise against putting them...

11 years ago | 1

| accepted

Answered
How to find the iteration number which gave me specific result?
Store the iteration number as well as the minimum. Or just use min with two outputs [minv, idx] = min(A)

11 years ago | 0

| accepted

Answered
'Clipping' the quiver plot
In R2014b, turning the clipping off works as I would expect: quiver(0.5,0.5,1,1) axis([0 1 0 1]) ax = gca; ax.Clipping =...

11 years ago | 0

| accepted

Answered
Loop confusion while assigning a function to a grid
mygrid = whatever for ii = 1:numel(mygrid) Y(ii) = call_my_function(mygrid(ii)) end

11 years ago | 0

Answered
What platforms does MatLab Base run off?
<http://www.mathworks.com/support/sysreq/previous_releases.html>

11 years ago | 0

Answered
Stopping a paused script
I would suggest a different approach. Rather than using a |pause|, put a break point on the line you want to pause on. Then ...

11 years ago | 3

Answered
Making two different color maps in 2014b
You can still use the freezecolors approach or one like I use in my <http://www.mathworks.com/matlabcentral/fileexchange/29485-m...

11 years ago | 1

| accepted

Answered
showing different parts of a dataset with different symbols in a scatterplot
% Synthetic data x = rand(60,1); y = rand(60,1); % Plotting scatter(x(1:20),y(1:20),'r*'); hold on scatter(x(21:...

11 years ago | 1

Answered
3-D matrix transpose
permute(A,[2 1 3]) |permute| is the way to generalize transpose-like operations in ND.

11 years ago | 3

| accepted

Answered
How to clear classes except some variables?
You shouldn't have to clear classes, this is a nuclear hammer approach. You need to clear classes when you the blueprint of the...

11 years ago | 0

Answered
Datafeed toolbox - IQFeed fails with a callback error?
Possibly a path issue, give this a try. If it doesn't work, then call tech support: restoredefaultpath rehash toolboxcach...

11 years ago | 0

| accepted

Load more