Answered
selecting unique values
in this case: I = [1 2 3 3 4 6 1 4 6] [b b] = unique(I(:,1),'first') out = I(b,:) please read ab...

14 years ago | 0

| accepted

Answered
edited-error in calculating mid point
K = [28 45781 5 0 0 13 31 77516 7 0 0 ...

14 years ago | 0

| accepted

Answered
error in calculating mid point
K = reshape([28 45781 5 0 0 13 31 77516 7 0 0 16 37 83311 9 0 0 40],6,[]).'; F_mid = conv2(K,[1 1;1 1]/4,'valid') for you.....

14 years ago | 0

Answered
matrix operation
[m k] = size(A); i1 = (1:m)'; r = 1:k; Mi = [2; 4; 1]; Mr = 1; out1 = bsxfun(@rdivide,i1*r.*q.^2,Mi)*Mr; out = sum...

14 years ago | 0

| accepted

Answered
Finding another point on the curve
try this is code: yout = interp1(t,y,.2016) *ADD* |yin| - your value of |y| tout = fzero(@(t1)yin - interp1(t,y,t1),0)

14 years ago | 0

| accepted

Answered
Extract a Portion of a Vector Based on the Indexes in another Vector
A - your vector column (first long vector) out = A(10:10:end); % your third vector

14 years ago | 0

Answered
Matrix conversion
a = [2 3 4 5 6 7 8 9 0]; b = kron(a,[1 1;1 1])

14 years ago | 0

Answered
Plotting a line (x versus y) then extracting interpolated values on the plotted line between the points I've input?
please read about function <http://www.mathworks.se/help/techdoc/ref/interp1.html |interp1|> try this is code, eg: X = l...

14 years ago | 0

| accepted

Answered
Error in flipping
F = img(end:-1:1,:,:);

14 years ago | 2

Answered
unequal vectors
variant M = A*[1 0] M(ismember(A,B(:,1)),2) = B(:,2) *ADD* _[11:47(UTC+4) 11.01.2012]_ can so? A = [10 11 12 13 14 15 ...

14 years ago | 0

Answered
Matlab matrix
ID = {'ID1' 'ID2' 'ID3' 'ID4' 'ID5' 'ID6'} data = [54 65 45 48 23 43 32 24 75 ...

14 years ago | 1

Answered
Symbolic computation
e.g. (R2011b): A = sym('A',[10 10]) A1 = sym('A1_',[100 1]) *OR* [x y] = meshgrid(1:10); for i1 = 1:numel(x) A2...

14 years ago | 1

| accepted

Answered
replacing a number
setdiff(F,D) *ADD* _[13:44(UTC+4) 10.01.2012]_ e.g. for every row of array |F|: >> D = [1 20]; >> F =[1 3 4 ...

14 years ago | 0

| accepted

Answered
multiplying a matrix
B = sum(A.^2,2);

14 years ago | 1

Answered
mthematica symbolic toolbox for matlab
<http://www.mathworks.com/matlabcentral/fileexchange/6044-mathematica-symbolic-toolbox-for-matlab-version-2-0 This is?>

14 years ago | 0

Answered
struct array
d = [Name;Temp]; Data = struct(d{:})

14 years ago | 0

| accepted

Answered
matching unequal arrays
output = ~ismember(m,n)

14 years ago | 0

| accepted

Answered
Convert floating point to binary
e.g.: a = 1234.57849; % your float point number n = 16; % number bits for integer part of your number m = 2...

14 years ago | 10

| accepted

Answered
To code based on percent in a matrix.
try this is code: a=[0 0 0 0 1 1 0 0; 0 0 0 0 0 0 0 0; 0 0 0 0 0 1 1 1; 1 0 0 0 0 0 0 0]; cases = {[...

14 years ago | 0

| accepted

Answered
Problem with using subs() for products of symbolic variables
use function |subsex| by |MuPAD| out = feval(symengine,'subsex', b + 3*a*b, 'a*b = 0')

14 years ago | 0

| accepted

Answered
Combining Matrices
e.g.: >> Ut = triu(randi(45,6)) Ut = 32 7 5 4 9 25 0 38 44 18 12 7 ...

14 years ago | 1

| accepted

Answered
To change value in cells based on conditions
n = size(a,1); K = reshape([a zeros(n,1)].',[],1)'; K(strfind(K,[33 33 33])+2) = 44 K(strfind(K,[33 33 22])+2) = 44 K(...

14 years ago | 0

| accepted

Answered
convert a 2D matrix into 3D matrix
|a| - your array (105504 x 3) out = permute(reshape(a.', 3,6,[]),[2 1 3]);

14 years ago | 0

| accepted

Answered
find/remove 2 consecutive letters from string
regexprep('.XNY.N','[.]N','')

14 years ago | 1

| accepted

Answered
Exclusion of Columns in a matrix
X = X(:,~abs(sum(X) - 1)<1e3*eps); *OR* S = sum(X); X = X(:,~abs(S - 1)<1e3*eps); *OR* X = X(:,abs(sum(X) - 1)>1e3*e...

14 years ago | 1

| accepted

Answered
Defining a constant 'a' as a limit of integration
syms y h a out = int(y.*(h-y),y,0,a*sqrt(3)) e.g. subs(out,[a h],[1 1]) *OR* h = 1;a = 1; out = quad(@(y)y.*(h-y),...

14 years ago | 0

Answered
Complex number determination
|z| - your number out = imag(z) ~= 0; if |out = true|, then |z| - complex number *OR* out = isreal(z) if |out = fals...

14 years ago | 5

| accepted

Answered
Logical Indexing into 2d matrix
a = [ 67 75 52 44 23 34 59 21 30 47 22 22 52 21 46 28 53 43 ...

14 years ago | 0

| accepted

Answered
To choose and shift an element randomly
try this is code: a=[11 11 22 22 33 33; 22 22 33 33 44 44; 44 44 11 11 22 22]; k = randi(size(a,2),size(a,1)-1,1); ...

14 years ago | 0

| accepted

Answered
To check coding
try this is code: s = size(a); b = zeros(s); b(abs(a - 33) < 1e3*eps) = -10; p = arrayfun(@(x)10*nnz(strfind(a(x,:),[33...

14 years ago | 0

| accepted

Load more