Answered
Extract data from countour and add two (or more) contours together.
The idea is to compute a new QxxPRIME for the different offsets and add them to QxxPRIME0 for zero offset: u = 80000; % ...

11 years ago | 1

| accepted

Answered
How to return only one of multiple identical max/min values?
x = [10 20 30 40 50 50]; x(find(x == max(x), 1, 'first')) or simply max(x)

11 years ago | 0

| accepted

Answered
How to create a wire of white dots
N = 2500; line_element = [1 1 0 0 0]; I1 = repmat(line_element, N, N/numel(line_element)); line_element = [ones(1...

11 years ago | 0

| accepted

Answered
creating Arrys from another big array
index=[1 25 40 63 77 99 100] A = rand(1,100); for i = 1:numel(index)-1 B{i} = A(index(i):index(i+1)); end Note t...

11 years ago | 0

| accepted

Answered
Is it possible to put subplots next to each other without any gap?
Use http://www.mathworks.com/matlabcentral/fileexchange/39664-subtightplot

11 years ago | 1

Answered
Performing equations on individual elements of a 3D Matrix, and then summing that along the z column
You can write the whole computations w/o a for loop in a one-liner. For example, if the equation is A+2 if A == 0 and A.^2 if A ...

11 years ago | 0

Answered
Legend on MATLAB FIGURES
h = legend(... % your code here set(h, 'FontSize', 8); % reduce font size used in legend

11 years ago | 0

Answered
Is there a way to do a by row comparison of two data sets with the same number of columns, different number of rows, and different parameters for each column?
A = [1.0001 2.0002; 8.1234 5.0]; B = [1.0002 3.0; 8.1235 3.0 8.1233 6.0]; tol = [0.001 1]...

11 years ago | 0

Answered
Take a lineout of a matrix, defined by a function
i = 1:size(M,1); f = @(i) i; M(sub2ind(size(M), i, f(i))) f = @(i) 4 - i; M(sub2ind(size(M), i, f(i))) f = @(i)...

11 years ago | 0

| accepted

Answered
Vector and matrix index operations
Use eval: myvect={'101AA21' '101AA22' '101AA23' '102AA21' '102AA22'}; mymatrix=magic(5); for i = 1:numel(myvect) ...

11 years ago | 0

Answered
can't find mexopts.bat
Try mex -setup

11 years ago | 2

| accepted

Answered
Faster method of creating list of looped row vectors?
kres=0.01; kx = -3:kres:3; N = numel(kx); k1 = repmat(kx, [N 1]); K2 = [k1(:) repmat(kx', [N 1]) repmat(0, [N^...

11 years ago | 0

Answered
How to copy content of of 7*14 matrix file(*.mat) to a table on Microsoft Word??
Try http://www.mathworks.com/matlabcentral/fileexchange/4643-table2word

11 years ago | 0

Answered
How can I reverse the direction of the rows and columns using printmat?
Use my function printmapud: function printmapud(a,name,rlab,clab) T = evalc('printmat(flipud(a),name,fliplr(rlab),cl...

11 years ago | 1

Answered
eval(['A = ',imtype,'(abs(V*D*V^(-1)));']) ??? Error using ==> mtimes Logical inputs must be scalar.
To trace down the error, please try whos V whos D A = abs(V*D*V​^(-1)); switch imtype case 'double', A = dou...

11 years ago | 0

Answered
How to implement following in matlab?
You can do this using nchoosek and ismember: A = [1 2;2 2;5 2;6 2;3 1;4 1]; col2val{1} = 2; col2val{2} = [1 2]; col2v...

11 years ago | 0

Answered
How to delete an object without a dot on it?
You can use bwlabel to label the binary image, L = bwlabel(I); then get the label of the phone using the coordinates of ...

11 years ago | 0

| accepted

Answered
hi-i have a one dimensional for loop and i need to change it to different dimensional?
If GT_New is defined to process 1X33 input, you replace the four line with R_KNM=KNM(NM,:); If you do not need R_KNM else...

11 years ago | 0

Answered
Remove unwanted lines from an image
I = im2double(imread('Untitled.png')); I = im2bw(I(:,:,1), 0.5); L = bwlabel(I); I(L== L(167, 10)) = 0;

11 years ago | 0

Answered
How to find similar elements with small difference (+/- 5%)?
One way would be to do this in a straight-forward loop: p = 0.05; % percentage of difference accepted C = nan(1, numel(...

11 years ago | 1

| accepted

Answered
How to find out radii of spheres when mean and standard deviation of radius distribution is know and sum of volumes of all spheres is constant?
First let's clarify some points: 1. If it is the volume, the unit should be unit^3; otherwise it would be the area of a circle;...

11 years ago | 0

| accepted

Answered
How do I plot the intensity profiles of a sequence of images?
As far as I understood is the problem not the algorithm but that the loop seems to run only once. First I would simply add a ...

11 years ago | 0

Answered
Does Matlab resize vectors automatically
That works because the : is matched here to a row or a column vector and converted to a row vector. So you can assign either a r...

11 years ago | 1

Answered
A simple code gives me an error, anyone help in this issue?
p is not known to your function. You have to define the function with all arguments you need inside: function y = van(v, a, ...

11 years ago | 0

| accepted

Answered
Why won't this for loop move to the next variable?
I you code only i cycles to the values 49,50, ..., while j and k are always a 4x1 vector [1; 18; 43; 63] and k = [1112; 1129; 1...

11 years ago | 0

Answered
interp1 and spline error
K = [ 0 34.4707 0.1000 29.2219 0.2000 33.9285 0.3000 30.2549 0.4000 27.5845 ...

11 years ago | 0

| accepted

Answered
How can I get X and Y column Matrices from plotted data?
[i j] = ind2sub(size(I), find(I == 0));

11 years ago | 0

Answered
How do I use Goto in MATLAB
From http://stackoverflow.com/questions/1082605/jump-command-in-matlab There is no goto statement in MATLAB, but there are a ...

11 years ago | 4

Answered
how to change the color of each point in the surface?
plot3(3,4,5,'b', 5,4,3,'r') If you have dozens of points use scatter3(x(:),y(:),z(:), [], col) where col is a Nx3 col...

11 years ago | 0

Answered
How i can calculate row wise avg of an image??
output = mean(temp1, 2);

11 years ago | 2

| accepted

Load more