Answered
Find data in specific range
out = dn(sd >= -.2 & sd <= .2);

14 years ago | 0

| accepted

Answered
Switch conditions or formula in a continuous data
try this is code idx1=L<X1; y(idx1) = E*F; idx2 = L>=X1 & L<=X2; y(idx2) = (G-H)*((L(idx2)-X1)/(X2-X1)); idx3 = L>X2;...

14 years ago | 0

| accepted

Answered
Reordering columns in a matrix
circshift(fliplr(A.*B),[0 -1])

14 years ago | 0

Answered
Conversion to double from sym is not possible
'f', from your code, replaced on 'x' syms x; A = [3*x , 0; 0.3*x , 0; 3 , 0; 1 , 0]; for a=1:2 for b=1:2 ...

14 years ago | 0

Answered
selecting values
A - your array with size 1000x1, e.g.: A = randi(125,1000,1); out = A(1:300) fprintf('%d\n',out)

14 years ago | 0

| accepted

Answered
Simbolic Toolbox: how to avoid conj() in matrix *
try use syms r real ... M=b.'*a

14 years ago | 16

| accepted

Answered
Neighbor searching
I = zeros(10); x = 4; y = 5; I(x,y) = 1; [yout,xout] = find((bwdist(I,'chessboard') == 1)'); variant 2 x=1:10; y...

14 years ago | 0

| accepted

Answered
how to delcare a 2 dimensional array in matlab?
array(i,j) = value;

14 years ago | 1

| accepted

Answered
Reshape Cell to Matrix
try this cod (small corrected, typo) d1 = datenum(data(:,1),'mm/dd/yyyy'); [a1,c1,c1] = unique(d1); [a2,c2,c2] = unique(d...

14 years ago | 1

| accepted

Answered
How to arrange rows in uitable?
EDIT small added [11:03MSD 28.12.2011] input matrices A=[1 2 3 0;1 2 4 5;0 9 7 0;1 3 4 6]; penalty=[-10; -20; -30; 0]; *1...

14 years ago | 0

Answered
Function to find if B is an echelon or row equivalent of A
|tstg| - function of test of gaussian elimination products tstg = @(A,B)abs(mod(det([A(1:end-1,:);B]),det(A))) < 1e6*eps; e...

14 years ago | 1

Answered
How can I make a differential matrics?
1) A,B,C - your matrix Mx = cat(3,A,B,C); Out = diff(Mx,1,3); a = unique(Out); 2) The inverse problem |A| - the initia...

14 years ago | 0

| accepted

Answered
Error in using fsolve
try this cod: b = [4;6]; F = @(x,b)[gamcdf(b(1),x(1),x(2))-0.4;gamcdf(b(2),x(1),x(2))-0.6]; [x,fval] = fsolve(@(x)F(x...

14 years ago | 0

| accepted

Answered
How to solve a system of equations involving distribution?
*EDIT* _[20:23MSD 26.12.2011]_: fh1 = @(x)[gamcdf(3.01,x(1),x(2));gamcdf(4.63,x(1),x(2))] - [.4;.6]; out = fsolve(fh1,[1;1]...

14 years ago | 0

Answered
unequal arrays and basic calculations
try this cod. Use function <http://www.mathworks.se/help/toolbox/stats/nanmean.html |nanmean|> by |Statistic Toolbox| num = [...

14 years ago | 0

Answered
Problem with solving
tau = input('Enter the value of tau: '); b = pi*(1-2*tau)/tau; syms x; result = solve(sin(x) - x - b)

14 years ago | 1

Answered
Error in quad function-maximum function count exceeded
try use |quadgk| for example: b=1;a=1;k=1;w=1; F = @(z) exp(b*z).*exp((6*a^2-1i*k*w^2*z)./(z.^2+a^2))./(a+1i*z) quadgk...

14 years ago | 0

| accepted

Answered
Sorting a Cell Array
Array = {'B' 'C' 'A';1 3 2; 'D' 'E' 'F'} out = sortrows(Array',1)'; OR [id id] = sort(Array(1,:)) out = Array(:,id)

14 years ago | 1

| accepted

Answered
Row-wise concatenation of a cell array
try this code, I can not test it, now do not have access to MATLAB |data| - your cell array (size 2xN) out = arrayfun(@(i1)f...

14 years ago | 0

Answered
Reshape Cell to Matrix
*EDIT* [13:20MSK 23.12.2011] data = {'IBM',1.01,1 'IBM',1.04,2 'IBM',1.06,3 'GOOG',.99,1 'GOOG',.98,2 'AAPL',1,1 ...

14 years ago | 1

| accepted

Answered
To calculate value in a uitable
try this code, I cant check now s = size(a); b = zeros(s); b(abs(a - 3) < 1e3*eps) = -10; k = [true(s(1),1) diff(a,1,2)...

14 years ago | 0

| accepted

Answered
matrix
A =[ 191 23 37 34 154 212 66 228 99 9 30 128 224 215 199 214 225 114 1...

14 years ago | 1

| accepted

Answered
concatenate cell
a={'kkk', 'lll', 'xxx', 'jjj.xls'}'; out = [a(:)';repmat({'_'},1,numel(a))]; out = [out{:}]; out = out(1:end-1); *_vari...

14 years ago | 0

| accepted

Answered
To put value in the specific column of uitable
s = size(a); j1 = arrayfun(@(x)find(a(x,:),1,'last'),1:s(1)); a(sub2ind(s,1:s(1),j1)) = 55; _*OR*_ if |a| - _cell array_...

14 years ago | 0

| accepted

Answered
Find in a matrix value pair.
k = { 'bc' 'ec' 'ed' 'cd' 'dc' 'ec' 'bc' 'be' 'ed' 'cd' 'ed' 'ae' 'bc' 'ec' 'ba' 'bb' ...

14 years ago | 3

| accepted

Answered
Extracting a field name from a cell array in a structure
A = name1.name2.name3.name4; idx = find(cellfun(@isstruct,A)); i2 = cellfun(@(x)any(strcmp(x,'name5')),cellfun(@fieldnames...

14 years ago | 1

| accepted

Answered
Basic matrix manipulation
t = A~=0 C = A; i1 = 2; % OR 1 or 3 C(t) = B(A(t),i1)

14 years ago | 0

| accepted

Answered
Elementwise product ef elements of a vector times a matrix
kron(b,A)

14 years ago | 1

| accepted

Answered
Optimizing a nested loop by summation
A = zeros(size(W)); for m = 1:size(O,1) for pix = 1:NumPixels L1 = L(:,:,m,pix); A = A + O(m,pix)*...

14 years ago | 0

| accepted

Load more