Answered
Creating a matrix by some other matrices
c = a; c(:,2)=b;

12 years ago | 1

Answered
I need to manipulate this cellArray
out = data(all(cellfun('isempty',regexp(data,'^0$')),2),:);

12 years ago | 0

| accepted

Answered
How to make monthly analisys for descriptive statistics
f = fopen('your_data.txt');c = textscan(f,'%s %s %f %f');fclose(f); [yyyy,mm] = datevec(c{1},'mm/dd/yyyy'); [a,b,c1]...

12 years ago | 0

Answered
Multiplication of elements in array
kb = bsxfun(@times,permute(b,[3,2,1]),k(:)); add kb = num2cell(bsxfun(@times,permute(b,[3,2,1]),k(:)),[1 2]); kb_ce...

12 years ago | 1

Answered
Filtering max values within every 3 hours of data
load upload.mat a = datatoupload; [~,~,~,hh] = datevec(a(:,1)); hh(hh==0) = 24; h2 = (rem(hh-1,3)+1)==1; h2(1) ...

12 years ago | 0

Answered
extract numbers from cell array
A1 = regexp(A,'[\d*\.]*\d*','match') A2 = [A1{:}] out = str2double(strcat(A2{:}))

12 years ago | 1

Answered
Create a cell array
perms('A':'E')

12 years ago | 0

Answered
Arranging the cell array in the corresponding rows.
c_in = {'a1ev01','a1ev02','a2ev01','a2ev02','a3ev01','a3ev02'}; ii = regexp(c_in,'\d*','match'); i1 = str2double(cat...

12 years ago | 1

| accepted

Answered
Algorithm which swaps the columns of a matrix A mx(n*2) without looping?
i1 = reshape(1:size(A,2),[],2)'; B = A(:,i1(:));

12 years ago | 0

| accepted

Answered
How do I extract a row of data from a cell array?
b = a(cat(1,a{:,3}) > 2,:)

12 years ago | 2

| accepted

Answered
To order min to max value for matrix's row
sort(a,2)

12 years ago | 1

Answered
How to calculate array by expression with sum, not using loops
N = numel(arr); k = 1:N; arr = cos((2*k(:)-1)*k(:).'*pi/N)*arr2(:)/N;

12 years ago | 0

Answered
move values from uneven size matrix
globbestseq(1,:) = gbestseq(1,:);

12 years ago | 0

| accepted

Answered
search the second column of a cell array according to the values in the first column
out = pippo{ismember(pippo(:,1),'nimp'),2};

12 years ago | 3

| accepted

Answered
multiply to matrix with strings
syms x b =[(1*x) (2+x) (3*5*x) (4*x^2)]; a =[ 1 2 3 4 5 6 7 8 9 10...

12 years ago | 0

Answered
Find value in a cell array if you have its index
n = cellfun(@numel,A); ii = cumsum(n); x = [A{:}]; out = x(B+[0;ii(1:end-1)]);

12 years ago | 0

| accepted

Answered
Write a (:,2) to a (:,6) matrix, depending on the value in (:,2) matrix.
dofn = reshape(1:15,3,[])'; NE = [1 2 2 3 2 4 3 5]; dofc = num2cell(dofn,2); DOF = cell2mat(dofc...

12 years ago | 0

| accepted

Answered
How to delete/subtract/make zero all the values above a specific value?
t = D > 255; out1 = D(~t); out2 = D; out2(t) = 0; out3 = D; out3(t) = out3(t) - 255;

12 years ago | 1

Answered
How to compare two matrices of different dimensions?
B=[1 18; 1 19; 3 1; 4 18; 4 20; 5 18; 6 12]; A=[1 18 19 19 20; 2 7 8 9 10; 3 1 2 2 3; 4 18 19 19 20; 5 18 19 19 20; 6 11 12 1...

12 years ago | 0

| accepted

Answered
how to use result of one function for another function??
function [ y ] = heatsource( c,d ) function [ x1, x2] = result( c, d ) x1=c+d; x2=c-d; end...

12 years ago | 1

Answered
why when i make conv between an averaging filter and a noisy circuit it doesn't get filtered?
n=0:499; x=sin(2*pi*n/50); y=x+0.1*randn(size(n)); h=[1,1,1,1,1]/5; z=conv(y,h,'same');

12 years ago | 0

Answered
Help with for cycle in a vector
out = blockproc(x,[1,3],@(x)mean(x.data)); or out = nanmean(reshape([x,nan(1,mod(-numel(x),3))],[],3));

12 years ago | 0

Answered
cells: How to take Mean over same-indexed elements across Cells?
A = arrayfun(@(x)randi(20,5 ,9),(1:4)','un',0); % your cell array out = mean(cat(3,A{:}),3);

12 years ago | 0

Answered
How to extract all the values from a while loop into a vector
function c = nice(n) c = n; jj = 0; while c(end) ~= 1 if rem(c(end),2) == 0 h = c(end)/2; ...

12 years ago | 0

Answered
How do I evaluate an integral over a matrix with unique functions in each element?
f0 = strcat('@(x,y)',repmat({'sin(x).*cos(y)'},2,2)); f0 = cellfun(@str2func,f0,'un',0); out = cellfun(@(z),integral2(...

12 years ago | 0

Answered
How to compute excess returns for several companies and dates?
ABC = {'A','B','C'}'; DATES = num2cell((19630101:100:19630601)'); ii = fullfact([3 6]); Df = [ABC(ii(:,1)),DATES(ii(:...

12 years ago | 0

Answered
Ask for partitioning a matrix
[~,~,c] = unique(abs(X(:,2))); out = accumarray(c,(1:numel(c))',[],@(x){X(x,:)}); _*add*_ [a,~,c] = unique(abs(X(:,...

12 years ago | 0

| accepted

Answered
Matrix formation by applying some operation using loop logic.
s = size(A); b = nchoosek(1:s(1),2); B = zeros(s); B(tril(true(s),-1)) = sum(min(A(b(:,1),:),A(b(:,2),:)),2); B = ...

12 years ago | 1

Answered
How to compute a numerical integration which still need a symbolic limit as a definition?
f = @(x)sym('a').*x; f1 = matlabFunction(int(f,sym('a'),1)); g = @(a)a.^3; out = quad(@(a)f1(a).*g(a),0,1);

12 years ago | 0

Answered
how to convert 1 D to 2 D matrix
|reshape| , |repmat| and other

12 years ago | 0

Load more