Rank: 5816 based on 19 downloads (last 30 days) and 1 file submitted
photo

Dario

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Dario
Updated   File Tags Downloads
(last 30 days)
Comments Rating
24 May 2009 compare, alltrue compares structs, cells and arrays element-by-element Author: Dario compare, cell, struct, string, array 19 5
  • 3.66667
3.7 | 3 ratings
Comments and Ratings by Dario
Updated File Comments Rating
25 May 2010 Gauss elimination with complete pivoting This function calculate Gauss elimination with complete pivoting Author: Nickolas Cheilakos

it seems, this doesn't compute P,L,U,Q such that P*A*Q = L*U
but such that A = P*L*U*Q or equivalently P'*A*Q' = L*U

Comments and Ratings on Dario's Files View all
Updated File Comment by Comments Rating
04 Feb 2010 compare, alltrue compares structs, cells and arrays element-by-element Author: Dario Groppe, David

Got the following error when trying to compare a struct variable to itself. Clearly some bugs still need to be worked out:

>> compare(GND.chanlocs,GND.chanlocs);
??? Error using ==> compare
Too many input arguments.

Error in ==> compare at 52
eval(['C.',field,'=compare(A.',field,',B.',field,');']);

27 Jan 2010 compare, alltrue compares structs, cells and arrays element-by-element Author: Dario Benavides, Jose

Adding the following code starting at line 51 fixed it for me. It was a matter of adding an extra for loop to handle the struct arrays.

strsize = length(A);
for i=1:size(Afields,1)
field = Afields{i};
for j=1:strsize
eval(['C(j).',field,'=strcompare(A(j).',field,',B(j).',field,');']);
end
end

Also helpful for me was adding the following code to check for equivalent nan values (the eq operation returns a 0 for nan's).

elseif isnumeric(A) || islogical(A)
if size(A)==size(B)
C = A==B;
AN = isnan(A);
BN = isnan(B);
NN = AN & BN;
C = C | NN;
else
error('Numeric and logical arrays must have the same size.');
end

05 Sep 2009 compare, alltrue compares structs, cells and arrays element-by-element Author: Dario kumar B T, naveen

hello, good day.
i m using 7.0.1 version.
i kept both compare.m and alltrue.m in workspace
i entered commands specified by you as below and got this result.
>> a.f1 = 'foo';
>> a.f2 = 'bar';
>> b.f1 = 'foo';
>> b.f2 = 'rab';
>> compare(a,b)
??? Too many inputs.

Error in ==> compare at 59
C = cellfun(@(a,b)compare(a,b),A,B,'UniformOutput',false);

Error in ==> compare at 49
if alltrue(compare(Afields,Bfields))

PLEASE FIX IT. thanks for your work. i welcome the reply.

19 Mar 2009 compare, alltrue compares structs, cells and arrays element-by-element Author: Dario ygal

Good job !

29 May 2008 compare, alltrue compares structs, cells and arrays element-by-element Author: Dario Boer, Pepijn

Works fine by me, but you should sort the fieldnames of a struct first, before comparing. Thus line 47 and 48 should become:
Afields = sort(fieldnames(A));
Bfields = sort(fieldnames(B));

Otherwise the order of the fields will be an issue, and it should be about the content.

Contact us