Answered
reading a data file with lines of different length
f = fopen('yourfile.txt'); c = textscan(f,repmat('%f ',1,4)); fclose(f); m = cellfun(@numel,c); k = arrayfun(@(x,y...

14 years ago | 0

Answered
index in a reshaped matrix
psz = size(P); [p1,p2] = corr(R,reshape(P,psz(1),[])); idx = p2 < .05; out = P(:,idx);

14 years ago | 0

| accepted

Answered
Make a matrix of different combinations.
one way [k1,k2,k3,k4] = ndgrid(0:2,0:2,0:2,0:1000); out = [k1(:),k2(:),k3(:),k4(:)]; or cmb = fullfact([3 3 3 10...

14 years ago | 0

Answered
How to access and use specific data from a structure
m = structfun(@max,Graph);

14 years ago | 2

| accepted

Answered
Please debug this code for me...
Try F9=(F8*B1B2*sind(D1B2B3+B3B2B1)+F6*B1B3*sind(alpha)-F7*B1B3*cosd(alpha))/B1B2*sind(B1B2P1) zero=F8*B1B2*sind(D1B2B3+...

14 years ago | 1

| accepted

Answered
cell array sort
[id,id] = sortrows(cell2mat(cellfun(@(x)x(1:2),A,'un',0))); out = A(id); other m = cellfun(@numel,A); k = arrayf...

14 years ago | 1

| accepted

Answered
How to convert a structure into a individual double elements
Try this is code A = struct2cell(yourstructdata); out = cat(2,A{:});

14 years ago | 6

Answered
Finding the end date of each month/year
*one way* dates =[ '23/11/08' '28/12/08' '25/01/09' '22/02/09' '29/03/09' '26/04/09' '24/05/09' '28/06...

14 years ago | 1

| accepted

Answered
Format Questions
Ac = num2cell(A); Bc = num2cell(B); D = [C;Ac,Bc(1:end-1,:);{'SUM'},Bc(end,:)]; E = [D;cell(1,4);{35, 12, 12, 14}];

14 years ago | 0

| accepted

Answered
integration of samples
Try function <http://www.mathworks.com/help/techdoc/ref/trapz.html |trapz|>

14 years ago | 0

Answered
Filtering rows of a matrix based on some columns
[a,b,b] = unique( A(:,1:2),'rows' ); B = [a,accumarray(b,A(:,3))]; C = B(abs(diff(B(:,1:2),1,2)) < eps(100),:);

14 years ago | 1

Answered
Vectorizing finding indexes
[idx,~] = find(bsxfun(@eq,ceil(X(:)'),Y(:)))

14 years ago | 0

Answered
Another data manipulation question,need some help!
[b b b] = unique(A(:,1)); C = B(b,:)

14 years ago | 1

Answered
rearranging a matrix in an efficient way
one way out = data(reshape(1:size(data,1),3,[])',:); %%% EDIT second way out = reshape(permute(reshape(data,3,[],3)...

14 years ago | 0

| accepted

Answered
Max in bin using histc
second variant [a b b] = unique(x); out = [a',accumarray(b',y',[],@max)];

14 years ago | 0

| accepted

Answered
ga-fitness
Can so? FitnessFcn = @(x)abs(A*x-B) ;

14 years ago | 0

Answered
Optimization of a nested loop
other variant CCI = (nnz(any(bsxfun(@minus,A,reshape(B',1,size(B,2),[])),2)) + size(A,1)*size(B,1))/2;

14 years ago | 0

Answered
how to count more than 1 element in cell array?
Can so? out = sum(cellfun(@(x)all(ismember([2 5],x)),D));

14 years ago | 2

| accepted

Answered
Structures and cells - how to modify and save
if C cell array with size (3 x 1158) then D=cell2struct(C,{'type','latency','urevent'},1); or C cell array with size...

14 years ago | 0

Answered
Delete row from Matrix
m = m(setdiff(1:size(m,1),[3,9]),:);

14 years ago | 6

Answered
??? Error using ==> vertcat CAT arguments dimensions are not consistent.
Can so? F11=zeros(size(x));

14 years ago | 0

Answered
two matrix problem
A=[1; 1; 1; 1; 1; -1 ;-1 ;-1 ;1 ;1 ;1 ;1 ;1]; B=[0.4; -0.2; -0.2; -0.25; 0.6; -0.3; 0.4; 0.2; 0.5; 0.3; -0.8; -0.9; 0.9]; ...

14 years ago | 0

Answered
*Import data from a file - HELP*
f = fopen('nameyourtextfile.txt'); cll = textscan(f,'%s'); fclose(f); c = cll{:}; i1 = ~cellfun(@isempty,regexp(c...

14 years ago | 0

| accepted

Answered
matrix nan
data = [2 3 nan 5 nan nan 9 3 2]; a1 = isnan(data); vle = mean(data([strfind(a1(:)',[0 1]);str...

14 years ago | 0

Answered
number of values greater than zero in a large matrix
Reducedmatrix = any(Grandmatrix); or? Reducedmatrix = sum(Grandmatrix~=0);

14 years ago | 0

Answered
replace one Listbox cell with another
|A| - your cell array with size (10 x 1) A([2,7]) = A([7,2]);

14 years ago | 0

| accepted

Answered
A complicated data manipulation--Help!
A ={... '15' 3854 4534 0 31 '10' 6331 0 346 0 '10' 4324 ...

14 years ago | 0

| accepted

Answered
I want to ascend cell
c{1,1} = cellstr(sortrows(char(c{1,1}),3));

14 years ago | 1

Answered
Data manipulation question, need some help!!
A ={... '15' 3854 '10' 6331 '10' 4324 '20' 3874 '25' 4321 '15' 6835 '10' ...

14 years ago | 0

| accepted

Answered
Find continuous elements in matrix
use functions |bwlabel| and |regionprops| from |Image Processing Toolbox| eg youridx = {10,6}; % coordinates of one "...

14 years ago | 0

| accepted

Load more