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

Rob Chambers

E-mail

Personal Profile:

I use MATLAB a lot, and I'll try to put up some of my code here in case anyone else can use it. Other m-files, along with my email address, can be found at my homepage: http://www.stanford.edu/~robc1

Professional Interests:
microfluidics, proteomics

 

Watch this Author's files

 

Files Posted by Rob
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Aug 2007 initializePhysicalConstants.m Creates a structure containing important physical constants (R, k, N_a, g, etc.) Author: Rob Chambers chemistry, physics, physical constants un... 1 2
  • 3.0
3.0 | 1 rating
Comments and Ratings by Rob
Updated File Comments Rating
25 Oct 2010 Colorspace Transformations Transform colors between sRGB, YCbCr, YPbPr, YUV, YIQ, HSV, HSL, HSI, XYZ, Lab, Luv, LCH, CAT02 LMS Author: Pascal Getreuer

Works great, appreciate the MEX code. Far more useful and well-done than matlab's conversions. I've been very impressed with all your stuff, Pascal :)

Comments and Ratings on Rob's Files View all
Updated File Comment by Comments Rating
20 Aug 2007 initializePhysicalConstants.m Creates a structure containing important physical constants (R, k, N_a, g, etc.) Author: Rob Chambers Chambers, Rob

John--very helpful comments, thanks. This is def. not the most robust way to do things, but as the m-file says, if people use the code I'm happy to improve it. Just a couple of points:
- These are all *very* important physical constants in every field of science/engineering; In many varied classes I've taken, at least 50% of the constants I need are contained in the list.

- The reason I didn't make this a function is that when CONSTS is loaded into your workspace, you can use the TAB functionality to explore the structure and find the variable you need.

It's nothing complicated, but for doing quick-and-dirty eng. calculations in matlab, I've found it to be very useful.

-Rob

19 Aug 2007 initializePhysicalConstants.m Creates a structure containing important physical constants (R, k, N_a, g, etc.) Author: Rob Chambers D'Errico, John

Its a little kludgy. First, its a script that always creates a structure with a fixed name, CONSTS. You need to edit the code to add your own constants, since surely those chosen will not be of interest to you. But, if you must edit the code, creating a cell array inside the code with a very specific format. In that case, why not just build a structure directly in a script?

There is no error checking on whether your cell array had the proper format.

If you want to know the units on a constant, then you need to dive into the description field, which is itself a scructure.

>> initializePhysicalConstants
>> CONSTS
CONSTS =
     N_a: 6.022e+23
    desc: [1x1 struct]
       k: 1.381e-23
       e: 1.602e-19
       F: 96480
       R: 8.314
     e_o: 8.854e-12
       g: 9.807
     p_o: 101300
     T_o: 273.15

The basic idea of a structure with your constants all in one place is not bad, or you might write it as a function, setting the constants as prefs, or use a function handle.

Top Tags Applied by Rob
chemistry, physical constants universal gas constant boltzmann faraday perm, physics
Files Tagged by Rob
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Aug 2007 initializePhysicalConstants.m Creates a structure containing important physical constants (R, k, N_a, g, etc.) Author: Rob Chambers chemistry, physics, physical constants un... 1 2
  • 3.0
3.0 | 1 rating

Contact us at files@mathworks.com