Answered
zero mean and one variance
Normally distributed: out = randn(1000,1);

12 years ago | 0

Answered
How can I generate a matrix?
a=[2,5,2,4,2,3,4,4,8]; b=[1,3,1,3,4,2,3,3,2]; sz = [8 5]; out = nan(sz + 1); out(2:end,2:end) = accumarray([a(...

12 years ago | 1

Answered
Solve a nonlinear equation
syms q >> ex = 1.082*( (q-1)*log((3/4 -3*q/4)/(1-3*q/4))+ q*log((3*q/4) *(3/4 -3*q/4)) + 1.4427*(-3*log(1-q/2) *((q/2) ...

12 years ago | 0

Answered
How to convert decimal hour and calculate the average every 5 min?
k = rem(UT,1)*60; tms = fix([UT,k]); m = ceil(k/5)*5; [~,b,ii] = unique(m); out = [tms(b,:), accumarray(ii,ROT,[],...

12 years ago | 0

Answered
Problem in assignning the real of complex number
x = complex(0,imag(x))

12 years ago | 0

Answered
Integrating a constant in MATLAB
R=5 mess=@(T)R; integral(mess,20, 30, 'ArrayValued',true)

12 years ago | 2

Answered
How Can I union four non-equal size vector in matlab?
A=[1 2 3 4 5]; B=[7 4 5]; C=unique([A(:);B(:)])

12 years ago | 0

| accepted

Answered
cell array into 3d matrix
permute(reshape(cell2mat(C).',numel(C{1}),size(C,2),[]),[3 2 1]) or reshape(cat(1,A{:}),[size(C), numel(C{1})])

12 years ago | 0

Answered
problem with matrix columns
A=[85 80 20 0 100;100 70 50 55 0;50 60 58 0 39;60 100 44 100 0]; a = [1.3 1.3 1.2 0 1.2;1.2 1.2 1.3 1.3 0]; [ii,~] =...

12 years ago | 0

| accepted

Answered
find member of element
[~,out] = ismember(right,b)

12 years ago | 1

| accepted

Answered
Put 3 columns of two matrix in 1 row matrix
reshape(permute(cat(3,X,Y),[3, 2, 1]),1,[])

12 years ago | 0

Answered
How do I create an m by n matrix with each row having the numbers 1 to n in a random order?
[~,ii] = sort(rand(m,n),2)

12 years ago | 0

| accepted

Answered
removing a complex infinity
x(real(x)==0&isinf(imag(x))) = [];

12 years ago | 0

Answered
How to remove unwanted values from an array?
f = fopen('C:\OneArray.txt'); ca = textscan(f,'%s %f %f %f'); fclose(f); f = fopen('C:\Example5.txt'); data = te...

12 years ago | 0

Answered
Look up a value in another array
EDIT d1 = [data(:,1), cellfun(@num2str,data(:,2),'un',0)]; a1 = [A(:,1),cellfun(@num2str,A(:,2),'un',0)]; [lk,i2] = i...

12 years ago | 0

| accepted

Answered
How convert an m x n x p image sequence to an m x n x 3 x p sequence efficiently?
A - array with size [m x n x p]. out = reshape(repmat(reshape(A,[],p),3,1),[m n 3 p]);

12 years ago | 1

| accepted

Answered
How can I delete duplicates in an array, with exceptions?
|A| - your array: [ii,ii,ii] = unique(A); out = A([true;diff(ii)~=0]);

12 years ago | 0

| accepted

Answered
How can I delete certain rows of a matrix based on specific column values?
Let |S| - your array. S1 = S(S(:,1) ~= 0,:); [ii,jj] = find( S1(:,2:end)); ss = sortrows([ii,jj],1); idx = accumar...

12 years ago | 2

Answered
problem in symbolic matrix multiplication
syms xlc B=[ 0.64*xlc - 1.2, 1.6 - 1.28*xlc, 0.64*xlc - 0.4; 0.64*xlc - 2.8, 4.8 - 1.28*xlc, 0.64*xlc - 2.0; 0.64*xlc - 4...

12 years ago | 1

Answered
Difference between two Vectors
ii = ~ismember(A,B) values = A(ii) index = find(ii)

12 years ago | 0

Answered
Help me vectorize this code
s = size(RE); [ii,jj] = ndgrid(1:s(1),1:s(2)); ij = sub2ind(s,ii(:),jj(:),bestori_map(:)); RE_p = reshape(RE(ij),...

12 years ago | 0

| accepted

Answered
Reshaping (M,N)-matrix to (M,1)-matrix
z = floor(log10(A)+1); z(isinf(z)) = 1; ex = fliplr(cumsum([zeros(size(A,1),1), fliplr(z(:,2:end))],2)); out = sum(A....

12 years ago | 0

| accepted

Answered
Undefined function or variable 'm'
m = sum((1:256)*p)

12 years ago | 0

Answered
Remove NaNs in matrices within cell array
out = cellfun(@(x)x(~isnan(x)),num2cell(A,1),'un',0); with for-end loop n = size(A,2); out = cell(n,1); for jj =...

12 years ago | 2

| accepted

Answered
How do you find the intersection points of two functions?
*EDIT* f1=@(x) 90.*exp(-x); f2=@(x) 3*sin(2*pi*x); f = @(x)f1(x)-f2(x); xx = 2:.1:7; t = f(xx) > 0; ...

12 years ago | 3

Answered
For loop with matrices
part1Fio = zeros([size(fo),numel(f)]); for ii = 1:length(f) part1Fio(:,:,ii)=(deltafo-deltao.*(fo-f(ii)))./((fo-f(ii...

12 years ago | 0

Answered
Normalization of matrix using matlab
A = randi(150,51); out = A/max(A(:));

12 years ago | 0

Answered
Doubt comparison of rows
A = [0 0 0 0 97790 0.0652150716905635 0 0 0 1 94450 0.0629876625541847 0 0 1 0 94954 0.0633237745915305 0 0 1 1 91739...

12 years ago | 0

| accepted

Answered
How to know the location of maximum value in a vector?
doc max [value,index] = max(A);

12 years ago | 0

| accepted

Answered
Data structure in Matlab
X - cell array: X = repmat({nan(100,200)},10,1);

12 years ago | 0

Load more