Answered
To transfer value of cell in uitable with another cell
A=a.'; [m,n] = size(a); C = cell(2,m); for i1 = 1:m d = A(:,i1); k = nnz(d); k1 = floor(k/2); d1...

14 years ago | 0

| accepted

Answered
check without using for loop
[m,n]=size(data); aaseq1 = cell(m,n); [d,ix] = sort(data,2,'descend'); ix(d==0)=inf; [i2,i2]=sort(ix,2); d1 = d...

14 years ago | 0

Answered
Solving dependend double integrals
try and read about |quad2d| f = @(x,y).... Q = quad2d(f,0,1,0,@(y)min(1-y,t+y)))

14 years ago | 0

| accepted

Answered
Small matrix values
e.g. |A| - your matrix A(abs(A)<1e-3)=0

14 years ago | 2

| accepted

Answered
cobinning values in an array
in your case: w{i,j} = cat(2,hor,vrt,dgr,dgl); _*variant*_ % e.g. data: M = reshape(arrayfun(@(i1){rand(randi([3 8]),...

14 years ago | 0

Answered
"FOR" loop
a = 1:100; yourprime = a(a - sum(rem(triu(bsxfun(@rdivide,a,a.')),1)>0)<=2); out = prod(yourprime(bsxfun(@plus,1:numel(y...

14 years ago | 1

Answered
regexp qwestion
TheString = 'gftr dsrew mkjghfdfsde' out = regexprep(TheString,'s','1')

14 years ago | 1

| accepted

Answered
Operating on syms class matrices.
_variant_ p1 = regexprep(char(A),'+','_') p2 = regexprep(p1,'*','+') out = sym(regexprep(p2,'_','*'))

14 years ago | 0

| accepted

Answered
Problem with quaternion rotation maths
try [c_yaw, c_pitch, c_roll] = quat2angle(camera_relative_to_balloon_quat,'ZXY');

14 years ago | 0

Answered
writing a for loop that solves on two arrays at the same time
x=1:5, y=1:5 solution n = numel(y); out = zeros(numel(x),n); x1 = x.'; for i1 = 1:n out(:,i1) = x1*y(i1); en...

14 years ago | 2

Answered
how to use regular expression to remove a prefix string with all 0s.
s ='012AB AB0 00230 0045 abc'; out = regexprep(s,'\<0*','')

14 years ago | 2

| accepted

Answered
Graphing problem
a=0.138*10^-6; x=0.5; step=8.64*10^4; t = 0:1:40; %fprintf(' Days Temperature(C) @ 0.5m\n') ts=t.*step; ...

14 years ago | 1

| accepted

Answered
Create an symbol array
long way :) m = 3; n = 4; [a b] = ndgrid(1:m,1:n); p1 = regexp(sprintf('A_%d_%d,',[a(:)';b(:)']),',','split'); ...

14 years ago | 0

Answered
Finding out number of columns with no NaNs
t = ~any(isnan(flow.data)); a2 = flow.data(:,t); c2 = [flow.textdata(t);mat2cell(a2,size(a,1),ones(size(a2,2),1))]; new_...

14 years ago | 1

| accepted

Answered
Multiply parts of matrices
_*variant 1*_ A = randi(100,8,6); B = randi(50,4,3); [m n] = size(A); q = 4; p = 2; a1 = reshape(permute(reshape...

14 years ago | 1

| accepted

Answered
cell arrey
C - your cell array out = num2cell(zeros(size(C))); t = cellfun('length',C)>1; out(t) = cellfun(@(x)x(2),C(t),'un',0);

14 years ago | 0

Answered
for loop
r = sort(randi(123,5,1)); a = sort(pi*rand( 5,1)); s = bsxfun(@(r,a)1/2*r.^2.sin(a),r,a.') _or_ s = .5*r.^2*sin(a)' *...

14 years ago | 1

Answered
Solving Matrices with Symbolic Variables
A =[ 1 2 3 4 5 6 7 8 9 0 1 2] syms a b c x = [a;b;c] k = A(:,1:3)...

14 years ago | 0

| accepted

Answered
Evaluating matrices of class "sym".
syms a b c d mtx = [ a^2 + b*c, a*b + b*d; a*c + c*d, d^2 + b*c] subs(mtx,[a b c ],[1 2 3 ])

14 years ago | 1

| accepted

Answered
problem in perimeter
*variant* use |conv2| without |Image Processing Toolbox| t = conv2(I,ones(3),'same')>0 out = t + 0 out(t>0&t~=I) = 2 ...

14 years ago | 0

Answered
Numerical Integration problem
use <http://www.mathworks.com/help/techdoc/ref/quadgk.html |quadgk|> for |quadgk(F,d,z)|, if |z = 4| then |F(4) = NaN|, divi...

14 years ago | 0

Answered
generating random signal
please read about function <http://www.mathworks.com/help/techdoc/ref/rand.html |rand|> in your case: out = 200*rand(2000,1)...

14 years ago | 5

| accepted

Answered
Get sum of similarites between rows
out = nonzeros(triu(sum(bsxfun(@eq,permute(a,[1 3 2]),permute(a,[3 1 2])),3),1)) _*or*_ n = nchoosek(1:3,2) out = a...

14 years ago | 0

Answered
Twin primes between 10 en 500.
a = primes(500); a = a(a>10); n = find(diff([a(1:end-1);a(2:end)])==2); out = a([n;n+1]).'

14 years ago | 2

Answered
help with editing variables
f1 = @(a)a + 3 b = f1(a)

14 years ago | 0

Answered
Reshape - columnwise. any command to linewise?
reshape(X.',M,N).'

14 years ago | 7

| accepted

Answered
Left-hand side indexing issue
here all right You want is it: B = A(:,[3 8 2 1 6 7 5 4])

14 years ago | 0

Answered
for loop question
n = 1:4; r = cell2mat(arrayfun(@(x)1:10*10^x,n,'un',0));

14 years ago | 0

| accepted

Answered
mutiplication and division of a range of number.
_*variant 1*_ F=@(x)-x(1)/(x(2)*x(3))*tand(x(4)) out = fmincon(F,[1 1 1 5],[],[],[],[],[1 1 1 5],[10 10 10 20],[],optimset(...

14 years ago | 0

Answered
Matrix Help
_*e.g.*_ i1 =[4 16 14 11] j1 =[8 1 4] x =[5 -6 -2 2 0 -11 -8 -4 ...

14 years ago | 0

Load more