help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Matlab geophysics code running in Octave


From: Lester Anderson
Subject: Re: Getting Matlab geophysics code running in Octave
Date: Sun, 4 Aug 2013 20:34:40 +0100

Hi,

Running the function, which should go all the way through and generate a plot gives this error -

octave:43> coheref2
error: 'defval' undefined near line 17 column 1
error called from:
error: c:\matlab\functions\simons_matlab\coheref2.m at line 17, column 1

function varargout=coheref2(infl,onfl,land)
% COHEREF2(infl,onfl,land)
%
% Expected coherence from Forsyth (1985)
% One elastic thickness, several loading ratios.
%
% Forsyth (1985), Figure 8.
%
% OUTPUT:
%
% Lots of handle variables
%
% See also: ADMITR, ADMITB, ADMITF2, COHERETE
%
% Last modified by fjsimons-at-alum.mit.edu, 03/07/2012

defval('infl',1)   <------------------ line 17
defval('onfl',1)

% Elastic thickness [m]
Te=40*1000;

The Matlab function that I found on the Internet, whether it is the right one I do not know, is in the same directory.

As I stated previously this code is from- http://geoweb.princeton.edu/people/simons/software.html under the section "Lithospheric flexure, loading and 2-D spectral analysis"
I am not a Matlab user, so this is all somewhat new to me. Looking at the way it is written, just typing the function name should work as the values of "infl, onl and land" are all defined with a value in the code (1), assuming I read it right. I am not sure how this is meant to run, so sorry if this is a very naive query for the experts.

There is no reference to this function in the manual and it certainly does not run on my system: using Windows 7 and Octave 3.6.4 (latest version with latest updates).

coheref2.m makes a call to forsyth.m to pass the result of a function back (see the original files). The coheref2.f function stops at the first reference to defval, soi it does not get as far as the plotting aspect. Is defval a system specific function?

Lester




On 4 August 2013 18:36, Juan Pablo Carbajal <address@hidden> wrote:
On Sun, Aug 4, 2013 at 6:29 PM, Lester Anderson <address@hidden> wrote:
> Defval is clearly a Matlab intrinsic function.

What do you mean with this. It is clear that defval is a user
function, not a function packaged with Matlab.

I tried several calls of defval.m and it doesn't fail in Octave 3.6.4.
What is exactly the problem you have? Why you aren't using this
function?
Methinks that if you are not getting the results you expect the
problem lays somewhere else. Could you identify exactly where is the
problem so we can help you?
Can it be a plotting issue?
What OS are you using?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]