[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Best practices in writing functions
From: |
c. |
Subject: |
Re: Best practices in writing functions |
Date: |
Wed, 4 Sep 2013 07:52:30 +0200 |
On 4 Sep 2013, at 05:08, Gordon Haverland <address@hidden> wrote:
> Greetings.
>
> I've been programming since the late 1970's. Never got into
> Octave stuff before now. Matlab has a function (raPsd.m, from
> someone in geophysics?) to do radially averaged power spectra. I
> am not looking for a power spectra, I am looking for a pair
> distribution function (materials science, condensed matter
> physics).
>
> Same math, different needs.
>
> The matlab function doesn't return anything. It assumes log-log
> plots and km as the X unit. I need either log-linear or linear-
> linear plotting, and I need to return both the radially averaged
> function and the 2D matrix of the power spectrum.
>
> It doesn't make sense to have a zillion different functions all
> doing about the same thing. Is there some octave function which
> does the "best" job, that I can use for a template? Can I
> contribute my modification to Octave? Is there guidance on
> contributing modified Matlab functions?
> I would have expected some of this to be FAQ, but maybe I didn't
> have enough coffee. I didn't see it. Sorry if I missed it.
There is a section in the FAQ about contributing:
http://wiki.octave.org/FAQ#How_can_I_get_involved_in_Octave_development.3F
and one about porting Matlab code to Octave:
http://wiki.octave.org/FAQ#Porting_programs_from_Matlab_to_Octave
I'd say if you want to contribute a function to Octave or Octave Forge
it doesn't matter whether it was originally written for Matlab or Octave as
long as it has a license that allows you to share modifications, in particular
you should take care taht your function does not come from the matworks File
Exchange
website as explained in yet one more FAQ:
http://wiki.octave.org/FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21
> Gord
Thanks for your interest in contributing to Octave,
HTH,
c.