Rank: 1743 based on 82 downloads (last 30 days) and 2 files submitted
photo

John McDermid

E-mail
Lat/Long
40.4656, -105.14248

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by John View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
25 Jan 2012 Units Conversion Toolbox This toolbox attaches units to Matlab variables and enables unit conversion. Author: John McDermid units, conversion, potw, pick of the week, toolbox 48 11
  • 4.875
4.9 | 9 ratings
13 Apr 2010 Circuit Analysis Toolbox The circuit analysis toolbox allows you to perform an AC analysis of a circuit. Author: John McDermid ac analysis, node voltage, branch current, gain, phase, monte carlo 34 1
  • 5.0
5.0 | 1 rating
Comments and Ratings on John's Files View all
Updated File Comment by Comments Rating
05 Nov 2013 Units Conversion Toolbox This toolbox attaches units to Matlab variables and enables unit conversion. Author: John McDermid Sinan

There is an error using units with offset.

test = unit('C');
answer = 2*(test+test);

answer should give result of
1096.6 = 2*(274.15+274.15);

I implemented the following to avoid this error.

In classdef unit in function U=unit(varargin) ...
switch nargin
...
case 2
%find this line

if isa(varargin{1},'double') && isa(varargin{2},'char')
X=unit(varargin{2});
U=X;
if U.hasBeenConverted == false
U.value=varargin{1}*X.value+X.offset;
U.offset = 0;
else
U.value=varargin{1}*X.value;
end

I hope this does not interfer with other functionalities, but my verifications showed no strange behaviour anymore.

Many thanks for your tool!
Best regards
Sinan

24 Aug 2012 Units Conversion Toolbox This toolbox attaches units to Matlab variables and enables unit conversion. Author: John McDermid M., Matthew

I've been thinking about incorporating this for a while, hemming and hawing. Tried it today, finally, and I'm sold. Great job.

I wish there were a way to match the display to the Command Window format setting - I generally like to display more significant digits than short g allows. But it appears that there's no easy way to retrieve the current command window display format (I'll bet Yair Altman could figure one out, but I couldn't). I know you can use the .value method to display it in the desired format, but that's sort of inelegant.

The workaround for me was to edit unit\display directly, changing the sprintf format from %g to %0.12g (I chose 12 rather arbitrarily).

Thanks!

30 Apr 2012 Units Conversion Toolbox This toolbox attaches units to Matlab variables and enables unit conversion. Author: John McDermid Marco

I cannot use this toolbox to find roots of polynomial using the roots function when coefficientes are unit-class type. I first have to define a isfinite function in the unit class, but then I have problems with the transpose and ctranspose function I am unable to solve myself. Can someone help?

30 Apr 2012 Units Conversion Toolbox This toolbox attaches units to Matlab variables and enables unit conversion. Author: John McDermid Marco

can you add this function to the unit class? Some formulas has absolute value in them, and I need to preserve units.

function C=abs(A)
A=unit(A);
C=A; C.value=abs(A.value);
end

02 Apr 2012 Units Conversion Toolbox This toolbox attaches units to Matlab variables and enables unit conversion. Author: John McDermid CIMADURE, Ronan

Perfect :)

Contact us