Answered
figure won't come up after using plot
Are you on Macintosh? I have problems with MATLAB figures hiding behind things, a major shortcoming of MacOSX in general. ...

15 years ago | 0

Answered
Logical Indexing for a slice of a 3D-Matrix
idx = find(MyMat1>5); %indices in 2d matrix MyMat2(idx+numel(MyMat1)) = MyMat1(idx); %indices in 3d matrix and extracted from...

15 years ago | 0

Answered
integer to the power larger integer = infinity
The limits of ieee754 floating point. Use John's VPI: <http://www.mathworks.com/matlabcentral/fileexchange/22725-variable-pr...

15 years ago | 0

Answered
Error message not connected
If the motor isn't connected it will error when it tries to connect to it because it won't be able to. Post the full error me...

15 years ago | 0

Answered
Find pixel coordinates value of a centroid ?
It works perfectly for me; I only had to modify the extraction to I instead of I3, as Walter and I had hypothesized about. ...

15 years ago | 0

Answered
Image Pixel Values
If J is your image and you want the mean of all values greater than 10: the_mean = mean(J(J>10)); You'll get a much more use...

15 years ago | 1

Answered
Find pixel coordinates value of a centroid ?
centroids = round(centroids); cent_vals = Inotbw(sub2ind(size(Inotbw),centroids(:,2),centroids(:,1)))

15 years ago | 0

| accepted

Answered
datatypes
You don't need to declare them as double; it's automatic. e1 = 107; e2 = e1 * 339; disp(e2/e1)

15 years ago | 0

Answered
How to vectorize the find function?
%small sample because you only looped over first row Z = rand(1,5,8)*2.5; z90 = rand(1,1,8); z10 = rand(1,1,8); %Your way ...

15 years ago | 0

| accepted

Answered
Toeplitz Matrix
T =tril(toeplitz([1 2 3 0 0 0 ],[1 2 3 0]))

15 years ago | 1

| accepted

Answered
Image Processing: Array Problem - right justify?!
Part 1: array(2,:) = fliplr(array(2,:)) Part 2: array(array==0) = nan; colmean = nanmean(array,1);

15 years ago | 1

| accepted

Answered
Finding the maximum value without using built-in functions
Those professors are wising up to the: the_max = min(-x); %or s = sort(x); the_max = s(end); tricks...

15 years ago | 0

Answered
Image registration with Gradient descent and SSD
I would recommend getting the brute force SSD criteria working first. Worry about optimizing (i.e. gradient descent) later. ...

15 years ago | 0

Answered
How to compare two images from each other: Round 2
For this rice example, what do you know about that grain that makes it different that the rest? * Its size (+- a few pixels d...

15 years ago | 1

| accepted

Answered
dividing a circle into six equal parts
Hmmm. A rambling of one way to do it, given a logical map of a circle: * Find the centroid. * Pick three angles at 60 degre...

15 years ago | 1

Answered
Image registration with Gradient descent
The for-loop can be vectorized with Ir = bsxfun(@times,gx,-(1:128))+bsxfun(@times,gy,-(1:128).');

15 years ago | 0

Answered
Adding 1 to odd numbers and 2 to even values of a matrix in an m file in MATLAB
M = magic(3); %example matrix idx = ~mod(M,2); %even places M(idx) = M(idx)+2; M(~idx) = M(~idx)+1;

15 years ago | 0

Answered
When to break the MATLAB rules?
When trying to write code to solve some type of image processing problem, I'll start with I, then I1, then I1opened, I2, I2dilat...

15 years ago | 1

Answered
Remove noise from an image
X = imread(your_image); Q = uint8(imclearborder(imfill(conv2(double(X(:,:,1)),ones(3),'same')<1400,'holes'))).*X(:,:,1); %qua...

15 years ago | 0

Answered
Remove noise from an image
I2 = bwareaopen(I,3);

15 years ago | 0

Answered
Telling MATLAB to wait
pause(0.5)

15 years ago | 1

Answered
The relative vertical position of the smallest connected black component
CC = bwconncomp(~BW); [junk, idx] = min(cellfun(@numel,CC.PixelIdxList)) [r c] = ind2sub(size(BW),CC.PixelIdxList{idx}); %How ...

15 years ago | 0

| accepted

Answered
How to compare two images from each other
Yes to all of your questions.

15 years ago | 1

| accepted

Answered
Help with a 3D graph
doc isosurface doc slice doc plot3 doc scatter3 A few places to look. There are numerous volume visualization too...

15 years ago | 0

Answered
show just one curve
Use cla to clear the old stuff and replot only what you want.

15 years ago | 0

Answered
Strings help! URGENT!!!
pixels = zeros(1,10); % pixels(1:10) will create a 10D array with 10! elements. Same with images To save the images for vie...

15 years ago | 0

Answered
pasting row elements as matrix
b = [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14]; N = 7; c = repmat(resha...

15 years ago | 1

| accepted

Answered
Empty Matrix
c = isempty(a) || isempty(b) || a>b

15 years ago | 0

| accepted

Answered
pasting row elements as matrix
Or do they mean: C = kron(b1,ones(N,2)) ?

15 years ago | 0

Answered
Let users enter integer, warn them if they enter anything else
input_hf = str2double(input('Enter an integer: ','s')); if isnan(input_hf) || fix(input_hf) ~= input_hf disp('Please enter...

15 years ago | 6

Load more