Answered
index exceeds matrix dimensions??
does dH_df of that line have any values <0.8? If it doesn't 'a' will grow to be bigger than the matrix and it would throw that ...

15 years ago | 0

Answered
Multiply vector elements by their index (optimization question)
%Sample data ary1 = (1:10).'; ary2 = rand(1,10); Points = 10; %Matrix Method v = (0:(Points-1)); ary4 = ary1+sum(exp(1i*(v'...

15 years ago | 0

Answered
Elegant code: How do I make my if,switch, etc. statements more compact?
just use a for-loop. All of your indices and results appear to be dependent on the case #. Use the case # to make your matrix....

15 years ago | 0

Answered
z=xy
perhaps you means an element-wise multiplication? z = x.*y; what you're doing above is a matrix multiplication from line...

15 years ago | 1

| accepted

Answered
Splitting Images?
swap1324 = @(x)([x((floor(size(x,1)/2)+1):end,(floor(size(x,2)/2)+1):end) x((floor(size(x,1)/2)+1):end,1:floor(size(x,2)/2)); ...

15 years ago | 2

| accepted

Answered
Creating 2D geometric shapes?
I would guess the image actually isn't losing information, you're just zoomed out enough that it's not displaying everything (co...

15 years ago | 1

| accepted

Answered
cog in a single image frame and multiple frames
Use the equation: <http://en.wikipedia.org/wiki/Center_of_mass here>

15 years ago | 0

Answered
Writing elegant MATLAB code
I would do your above operation with: rgb3 = zeros(size(rgb)); for ii = 1:3 rgb3(:,:,ii) = sum(bsxfun(@times,reshape(...

15 years ago | 0

Answered
Displaying series of images in an axes in a GUI
Use the axes(H) command to set the current axis to your axis of choice doc axes

15 years ago | 1

Answered
How to save a variable from a function and use it in another function in MATLAB GUI?
<http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F FAQ>

15 years ago | 1

Answered
3-D Surface
<http://blogs.mathworks.com/loren/2011/06/13/calculating-the-area-under-a-surface/ Loren's Blog Entry>

15 years ago | 1

Answered
plotting selected lines from a matrix
doc subplot Then use a FOR-loop to navigate through. figure; for ii = 1:3 subplot(3,1,ii) hold on plot(matrix(...

15 years ago | 1

Answered
beyer matrix
Try imshow(R,[]); You may just not be looking at the full range of values. *ADDENDUM per comment* I'm not sure what you're ...

15 years ago | 0

Answered
Update Graph With Data Input
You want drawnow doc drawnow; for more info

15 years ago | 0

Answered
Saving a result of each loop´into a new vector
A = zeros(length_of_column,number_of_vectors) for ii = 1:number_of_vectors a_result = some_function(stuff(ii)); A(:,ii...

15 years ago | 0

| accepted

Answered
??? Error using ==> mldivide Matrix dimensions must agree.
What line does it say the error is on? I'll bet it's on that line where you do a left matrix division '/'.

15 years ago | 0

Answered
How to find the size of a cell array
A = cell(20,11); size(A) ans = 20 11 works for me... ? Or do you want the size of the contents of each cell? cells...

15 years ago | 6

| accepted

Answered
how to use mod in variable that have big value
No. You've hit the limits of double precision floating point arithmetic. You would want vpi, which is no longer available, or ...

15 years ago | 0

| accepted

Answered
how to set gui's input to decimal
str2double is what you want doc str2double

15 years ago | 0

| accepted

Answered
noise levels
A = 20; %amplitude of 10 - noise noise = (rand(size(I))-.5)*A); Inoisy = I+noise;

15 years ago | 0

| accepted

Answered
Draw the mode shapes and get the natural frequencies of the cantilever beam(with a force in free end)
Aren't the eigenvectors the buckling modes? ~ Corresponding to the (ascending) sorted eigenvalues? To change it to a cantilev...

15 years ago | 0

Answered
finding interior region
You could also do an Ibwnoholes = imfill(I,'holes'); which will fill the holes and then that boundary won't show up.

15 years ago | 0

Answered
substituting values into an array
You can't have period(0), it tries to reference this when i = 1 period(2,0:end); %substituting T(1) Start your indexin...

15 years ago | 0

| accepted

Answered
2D points to 3D Matrix
So put them in order! Then do the work: idx_sorted = sortrows(xypts,[1 2]); %sort them ij = reshape(idx_sorted,[10 14 2]); ...

15 years ago | 0

Answered
Vectorize calculating a co-variance matrix for every RGB pixel in an image
<http://www.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-with-multi-dimensional-support FEX: mtim...

15 years ago | 0

Answered
Matlab rounding to zero?
int16((.05/65536)) ans = 0 Multiplication by zero is always zero... Convert to single or double precision.

15 years ago | 1

Answered
can this code be sped up?
Mat = zeros(n,m); before the two for-loops will speed this up immensely for large [m n]. Also, you don't need to set j=1 in ...

15 years ago | 0

Answered
Out of memory problem
Even of class double a 512x512x200 matrix is only 419430400 bytes - hardly very much in today's world. How many other variable...

15 years ago | 0

Answered
fsolve
preallocate beta beta = zeros(nmax+1,1); beta(1) = beta_of_1; for ii = 1:nmax beta(ii+1) = fsolve(F,beta(ii)); end *EDIT...

15 years ago | 0

| accepted

Load more