Answered
snakes and ladders
Why reinvent the wheel? <http://www.mathworks.com/matlabcentral/fileexchange/3908-snakes-ladders-game FEX:snakes+ladders>

15 years ago | 0

Answered
Is it possible to have 3 or more variable inputs for a 3D contour plot in GUI?
An |isosurface| with different colored and shaded |patch| es can be used to visualize 4d data. doc isosurface doc patch

15 years ago | 0

Answered
how to display VERY LARGE images (460,800,000-element matrices) in matlab?
* what's the best way to do it? what's the best command? I would recommend downsampling your images for the purpose of viewing....

15 years ago | 1

Answered
find max of a vector between two indice
Easiest, and likely fastest way is just to use a |for|-loop: A=[3 7 13]; B=[-5 3 -8 1 -7 2 -9 3 6 2 7 9 -4 2 6]; nmax = le...

15 years ago | 2

Answered
Greek letters, subscripts, and superscripts in the editor
Sure you can, you just have to use LaTeX. See the example in: doc Matlab>User Guide>Desktop Tools>Publishing M-Files>Fo...

15 years ago | 0

Answered
can any one explain sum(sa1.^2) and unit energy
break it down into components: sa1 %variable or function with no inputs and at least one output sa1.^2 %sa1 squared elem...

15 years ago | 0

Answered
GUI variables not going to workspace
Those variables are in their own workspace. Use |assignin| to get them to the base if you need them there: doc assignin ...

15 years ago | 0

| accepted

Answered
index exceeds matrix dimensions help (new to matlab)
k = 1:6 i.e. k = [1 2 3 4 5 6] for i = k+1 translates to MATLAB as for i = [2 3 4 5 6 7] your matrices are ...

15 years ago | 0

| accepted

Answered
how to show grid lines?
Do you have anything plotted? There has to be something plotted for the grid to be visible. plot(1:10);grid on

15 years ago | 2

| accepted

Answered
matrix, plot
A = cumsum(rand(5,100)'); %5 channels plot(A) %plot the 5 channels hold on %hold the plot so it doesn't overwrite plot(1:...

15 years ago | 0

Answered
quantized colorbar
X = sign(round((rand(10)-.5)*2)); imagesc(X); un_X = unique(X); colormap(cool(length(un_X))); H = colorbar; set(H,'ytick',un_X...

15 years ago | 1

| accepted

Answered
adding color in command-window output...
Built-in, the only way I know of is to make it red: fprintf(2,'\nHello world\n') use _2_ as the fid. However, Yair's ...

15 years ago | 13

| accepted

Answered
normalized 2D cross correlation
No. |normxcorr2| requires that the elements be finite, i.e. not nan and not inf. The normalized cross correlation algorithm is...

15 years ago | 0

| accepted

Answered
Plotting different colours
figure; hold on plot(1:100,x(1:100),'b-'); plot(101:(101+597),x(101:(101+597)),'r-'); %etc. They key is to use hold on ...

15 years ago | 0

| accepted

Answered
How to get Matlab to recognize a number string as a date?
doc datenum & friends

15 years ago | 0

Answered
Area of Triangle
Yes, use Heron's numerically stable algorithm. Here's a function I wrote to do it with the output of the |isosurface| function:...

15 years ago | 2

Answered
Help open
|edit| is a very powerful and useful builtin MATLAB function. Your script named _edit_ is overwriting this making _open_ fail w...

15 years ago | 0

Answered
Change or remove duplicate matrix elements
X = [1 2 3 3 4 5 2]'; X2 = sort(X,1); idx = [false;diff(X2)<(10^-6)]; %equal to 10^-6th precision X2(idx) = X2(idx)+.1;

15 years ago | 0

| accepted

Answered
if statement problem
if Y(1:i,1)>=1 let's say Y = [0 1 2 3]' ; for i = 1:4 if Y(1:i,1)>=1 disp('yup'); else ...

15 years ago | 2

Answered
problem in the my matlab code at demodulation with counting error (xor) bits are not equal / balance it showing in command prompt
So what is the problem? Type: dbstop if error and then run it, the program will stop when an error occurs and you can...

15 years ago | 0

| accepted

Answered
random number generation with changing probability
This should do it: function X = probVals(sz,vals,probs) %Creates a matrix of values occurring at specified probabilities ...

15 years ago | 1

Answered
autocorrelate rows of matrix without using a for loop
for m=10:-1:1 b(m,:)=xcorr( a(m,:) ); end

15 years ago | 0

Answered
imwrite and imshow problem
Yes, by viewing with imshow and the [] (full range) option you're seeing the full range of values. Otherwise, you're seeing onl...

15 years ago | 0

Answered
volume of set of points in 3-d space
Please see Steven Lord's wonderful reply here: * <http://www.mathworks.com/matlabcentral/newsreader/view_thread/256591 Old:Ne...

15 years ago | 0

Answered
How can I count special type of combinations with matlab?
Anyway, darkness golf: * 40 characters: to return the matrix of combos without suppressing output and assigning to 'ans' * 36 c...

15 years ago | 0

Answered
cellfun for objects
I don't know if there is a way to make _that_ work, but I can advise against doing it! *Don't Do It!* <http://matlab.wikia...

15 years ago | 1

Answered
Subplotting images with different scale
Create the figure and axes explicitly and then use them: H.f = figure; %new figure set(H.f,'units','pix','position',[100 10...

15 years ago | 0

Answered
Assigning actual distance to a matrix
Use meshgrid to set up the actual distances [xx yy] = meshgrid(0.5:.5:50); mesh(xx,yy,magic(100)) Above I wasn't sur...

15 years ago | 1

Answered
How to have input function continue if enter key pressed
Could you use an |inputdlg| instead of |input|? It'll give you a few more options as far as |keypressfcn/keyreleasefcn| since i...

15 years ago | 0

Load more