Answered
label2rgb() and custom color assigment
Feed it an nx3 map of colors you want with each row of the map corresponding to that label, e.g: x = [1 0 2]; label2rgb(x,...

14 years ago | 0

Answered
get regions properties in specific part of a frame
Use |bwdist()| to locate pixels within 100px of your Pixel-of-Interest ( |bwdist| even provides fancy alternate methods of doing...

14 years ago | 0

Answered
Extract columns of data from a 3D matrix and store each column as a new variable.
You _actually_ don't want to do this! # <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in...

14 years ago | 0

Answered
MAtlab GUI Axis tag problem (MAtlab GUI forgets to call the tag name of axis)
If the GUI is created in GUIDE, use the property inspector in GUIDE to give the axes a tag. After this, it should maintain its ...

14 years ago | 0

Answered
background for design gui
<http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples>

14 years ago | 0

Answered
Image Rotation
doc maketform doc imtransform Or you could pad the image so that the center of rotation is the center, use |imrotate| and ...

14 years ago | 0

| accepted

Problem


Is X a Fibonacci Matrix?
In honor of Cleve's new blog and post: <http://blogs.mathworks.com/cleve/2012/06/03/fibonacci-matrices/> Is X a Fibonacci ...

14 years ago | 14 | 789 solvers

Solved


Is X a Fibonacci Matrix?
In honor of Cleve's new blog and post: <http://blogs.mathworks.com/cleve/2012/06/03/fibonacci-matrices/> Is X a Fibonacci ...

14 years ago

Solved


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

14 years ago

Answered
Very simple vectorization ?
hello = 0:9;

14 years ago | 1

Solved


Make an N-dimensional Multiplication Table
*INSTRUCTIONS* This is a multi-dimensional variant of the normal multiplication table used to teach elementary students multi...

14 years ago

Answered
Question on optimization problem and fminsearch,fminunc,lsqnonlin
The initial guess is important because the above mentioned optimizers are trying to find a local minimum, i.e. the one closest t...

14 years ago | 0

Answered
Erode/dilate commands in three dimensions?
# packopt: _notpacked_, shape: _same_ # imerode(im,se,'full') # Yes. %sample_script.m imerode(rand(10,10,10)>.2,str...

14 years ago | 0

Answered
Sorting cell array of strings wrt. a character
SM={'JJ','AKs','TT','AQs','AKo','AJs','KQs','99','ATs','AQo'} idx = cellfun(@(x)any(ismember('so',x)),SM); %which ones ha...

14 years ago | 0

| accepted

Answered
connect two uicontrol object with a line
You could use an invisible axes in the background and draw line objects. For example: fig = figure('units','pix'); pos ...

14 years ago | 4

| accepted

Answered
Coolest things MATLAB can do
_"Cool"_ can mean lots of things. The fact that it is used to makes tools which greatly improve (or save) the lives of many is ...

14 years ago | 4

| accepted

Answered
Loading image into GUI
<http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples FEX: MAtt's GUIs> Some of these will help...

14 years ago | 0

Answered
Linkage Function: solving tie breaks?
You could add a breakpoint to |linkage| and run it with a scenario that causes a tie and step through it.

14 years ago | 0

Answered
??? Error using ==> feval Undefined function or method 'XX' for input arguments of type 'struct'.
This sounds like the folder containing said *.p files is not on the path. Use the |pathtool| to add them and save the path: ...

14 years ago | 0

Answered
word frequency
Something like: str = 'See Spot run, see Spot jump, see Spot eat'; C = regexp(lower(str),' ','split')'; [val,...

14 years ago | 0

Answered
Change linespec of a line using only the figure handle.
hAxChild = get(get(gcf,'children'),'children'); %children of the figure's axes Then figure out which ones are lines etc.. ...

14 years ago | 1

Answered
a(a==NaN) does not find NaN's in matrix. What to do?
NaNs are not equal to themselves! You could thus do either of these: * a(isnan(a))=0; %isnan * a(a~=a) = 0; %nans are...

14 years ago | 2

| accepted

Answered
Array manipulation with loop
A+N

14 years ago | 0

| accepted

Answered
"For loop" not allowed in commandscript called inside nested function?
Did you look into the link with the error message: <http://www.mathworks.com/help/releases/R2012a/techdoc/matlab_prog/f4-3968...

14 years ago | 1

| accepted

Answered
Adding zeroes to Row Vector using a script
x2 = zeros(1,2*numel(x)); %thanks Andrei! x2(1:2:end) = x; Or: reshape([x;zeros(size(x))],1,[])

14 years ago | 0

Answered
Error Attempted to access x(2,1); index out of bounds because size(x)=[1,4]
Apparently the regression function is fed a row vector rather than a column vector. To fix this, use: J(1,2) or to be even s...

14 years ago | 0

Answered
Finding Unknown X from Known Y with cftool
First: This a good question. +1. After you're done fitting with the CFTOOL go to "fit">"Save to Workspace". This will then ...

14 years ago | 0

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

14 years ago

Solved


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

14 years ago

Answered
Y- axis marking
Get it and reset it: x = plot(1:100,rand(1,100)*120000); ylim([8000 10000]); set(gca,'yticklabel',get(gca,'yticklabel'))

14 years ago | 0

Load more