Answered
Merge array to a number
str2double(sprintf('%d',x))

15 years ago | 3

| accepted

Answered
How to import an avi-file?
mov = aviread('125.avi') so?

15 years ago | 0

| accepted

Answered
Intergation problem
C = 1; a = 0; b = 1; quad(@(x)exp(-C./x),a,b) about plot fun = @(x)arrayfun(@(x)quad(@(x)exp(-C./x),0,x),x); plot(...

15 years ago | 0

Answered
Can I trust the quad integration results with a warning of "minimum step size reached"?
Hi friends! @Lin LI: use |quad| or |quadgk|: a1 = arrayfun(@(j1) quad(@(x) 1- exp(-x.^2/12.5),15-j1/10*2,3), (1:151)')

15 years ago | 0

Answered
Vector mirror?
doc fliplr x(end:-1:1) or fliplr(x)

15 years ago | 4

| accepted

Answered
Constraints
xyz = randi([0 28],15,3) llt = [5 0 6] rlt = [10 4 12] id = bsxfun(@lt,llt,xyz)&bsxfun(@gt,rlt,xyz) out = arrayfun...

15 years ago | 0

Answered
Matrices question (2)
Phi = vN; Theta = vP; [vmx1,idx1] = max(F); Fmaxphi = [vmx1;Phi(idx1);Theta]; [vmx2,idx2] = max(F,[],2); Fmaxtheta =...

15 years ago | 0

| accepted

Answered
want to follow my iteration - how?
v_m=10; R_try=0; v_m_try=0; i1 = 0; while abs(v_m_try-v_m)>0.01 && i1 < 100 if v_m_try<v_m R_try=R_try...

15 years ago | 0

| accepted

Answered
Asign values to pixels
variant x = rand(1,10) [v,i12]=sort(x) out = interp1([1 i12([1,end])-[-eps,eps] numel(x)],[1;1]*v([1,end]),1:numel(x)) *...

15 years ago | 0

Answered
Newton's method problem
for your case *EDITED* f = @(x)(x - 4)^2 + 9; syms x ex = (x - 4)^2 + 9; cf = double(coeffs(ex)); distxp = (4*prod(cf([1 end...

15 years ago | 1

Answered
how to select random rows from a matrix?
m = rand(10037,9); k = randperm(10037); mnew = m(k(1:1000),:);

15 years ago | 9

Answered
how can i modify this short program so that it executes faster?
theta =.5:.5:360; phi =(0:.5:180)'; r = sind(270*cosd(theta)).^2./(3*sind(90*cosd(theta))).^2; r(isnan(r)) = 1; x = co...

15 years ago | 2

Answered
Functions and For loops
Please read <http://www.mathworks.com/help/techdoc/learn_matlab/f2-12841.html#f2-428 about colon operator>, <http://www.mathwork...

15 years ago | 1

Answered
Read vectors into a matrix of NaNs??
SalMat = nan(25) c = arrayfun(@(x)randi(randi(123),randi(25),1),1:25,'un',0) for j1 = 1:size(SalMat,2) SalMat(1:nume...

15 years ago | 0

Answered
not to use loops
[zout,idx] = max(z); [m n] = size(x) ind = sub2ind([m n],idx,1:n) xout = x(ind) yout = y(ind)

15 years ago | 0

| accepted

Answered
without using loops
[yuk,idx] = max(z)

15 years ago | 0

| accepted

Answered
Cell Function
data2 = cellfun(@(x){mean(x) detrend(x)},x,'un',0) *ADD* data2 = cellfun(@(x)[mean(x);detrend(x)],x,'un',0) datadouble =...

15 years ago | 0

Answered
how to find roots of equation having tan(x) or exp(x)
fzero(@(x)exp(x)+x-10,0) fzero(@(x)tan(x)-x-.01,0) fzero(@(x)tan(x)-x-.01,pi)

15 years ago | 1

Answered
finding average
EEG0ave = sum(EEG0,2)/size(EEG0,2); % you average without mean function etc.

15 years ago | 0

Answered
can anyone please help me with these "if" "elseif" thingy..
inpdata = [13, 4.15, 0.2, 0.2 12, 4.15, 0.25, 0.25 25, 0.2, 1.0, 1.0 0, 0.15,...

15 years ago | 0

Answered
()-indexing must appear last in an index expression
EDIT Mean1 = squeeze(sum(data)./sum(data~=0))%first dimension Mean2 = squeeze(sum(data,2)./sum(data~=0,2))%second dimens...

15 years ago | 0

| accepted

Answered
how to find cycle in data
more variant d1 = data(:,2)>=70 & data(:,2) <= 150; b = find([true;diff(d1)~=0;true]); b2 = [b(1:end-1),b(2:end)-1]; ...

15 years ago | 0

Answered
datestr, add non-interpreted characters into format
data = {'2011-01-04_16h50m20s' '2010-11-30_07h00m02s'} date2 = cellfun(@(x)[x{:}],regexp(data,'[-_hms]','split'),'...

15 years ago | 2

| accepted

Answered
How to align multiple tables/matrices based on the first column
variant 1 function zout = funforDZ(zin,r1) %{ All matrixs (A,B,C ... and etc.) include in cell array 'zin' zin = {...

15 years ago | 0

| accepted

Answered
Simple Interpolation with interp1
time = [0 sort(randi(120,1,5))] velocity = randi(120,1,6) t = linspace(time(1),time(end),100); rl = interp1(time,velocit...

15 years ago | 0

Answered
Common factor
help factor syms a b c factor(a*c + b*c)

15 years ago | 0

Answered
quad
L = 10; out = quad(@(z)L*z./(L/2+z).*exp(-2*z/L),0,10);

15 years ago | 0

| accepted

Answered
is this code correct?
testing your code _(edited)_ all(diff([sum(M),sum(M,2)',sum(diag(M)),sum(diag(M(:,end:-1:1)))])==0) &&... ...

15 years ago | 0

Answered
summation
sum(A(:)) % A - double array 2d

15 years ago | 0

Answered
Return all unique rows with unique elements
variant (edited 09/28/2011 13:00 MDT) xu = unique(x); [~,loc] = ismember(x,xu); [a,b] = unique(sort(loc,2),'rows','first'...

15 years ago | 0

Load more