help-octave
[Top][All Lists]
Advanced

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

Re: (no subject)


From: Doug Stewart
Subject: Re: (no subject)
Date: Fri, 10 Jun 2016 06:54:56 -0400



On Fri, Jun 10, 2016 at 6:45 AM, Lester Anderson <address@hidden> wrote:
Hi Doug,

Checked the demo file and it does have the required 8 columns:

15.417    16    176.5    193    2715    0.61    0.665    1
10.11    15.417    142    176.5    2671    0.342    0.532    1
9.805    10.11    137    142    2650    0.27    0.49    1
9.377    9.805    127    137    2710    0.71    0.7    1
8.752    9.377    112.2    127    2720    0.51    0.63    1
8.502    8.752    110    112.2    2710    0.71    0.7    1
7.735    8.502    98.9    110    2720    0.51    0.63    1
7.61    7.735    93.5    98.9    2710    0.71    0.7    1
7.31    7.61    83.5    93.5    2713    0.65    0.679    1
6.235    7.31    65    83.5    2709.5    0.474    0.609    1
5.01    6.235    55    65    2692    0.414    0.574    1
5.01    5.01    43    55    0    0    0    2
4.75    5.01    35.3    43    2669.469    0.337    0.529    2
4.15    4.75    31.1    35.3    2685    0.39    0.56    2
3.15    4.15    23.8    31.1    2685    0.39    0.56    2
2    3.15    12.7    23.8    2678    0.366    0.546    2
0    2    5.4    12.7    2679    0.372    0.55    2

The separator is tab.


I copied this data to a file and it works. So I don't know what is wrong with your system.

Please bottom post.
Doug 
On 10 June 2016 at 11:37, Doug Stewart <address@hidden> wrote:


On Fri, Jun 10, 2016 at 5:49 AM, Lester Anderson <address@hidden> wrote:
Hi Kai,

Thanks for the info and the code tweak; seems to be ok for one
function. Basically trying to get a public-domain code to run
(http://www.ux.uis.no/~nestor/work/matlabScripts.html) and
specifically 1D Airy backstrip.

With your code tweak it seems to run, but I am not sure it is reading
the datafile, which should create a 2D matrix (A), however A() does
not show up in the list of variables.

%read parameters from a txt file

[datafile] = uigetfile('*.txt','Choose a txt file');
A=load(datafile); <- this should be fine
these 2 lines work for me.
Maybe your txt file does not have 8 coulombs?


 
zt = A(:,1);
zb = A(:,2);
agetop = A(:,3);
agebas = A(:,4);
psed = A(:,5);
c = A(:,6);
surpor = A(:,7);
basset = A(:,8);

flagfile = 1;
flagunits = 1;
flagage = 1;
flagdens = 1;
flagporo = 1;

Running the code :
>> backstrip
>> error: water: A(I): index out of bounds; value 2 out of bound 1 - suspect this is because the matrix A is not loaded?
error: called from
    water at line 55 column 19

Leste



On 10 June 2016 at 09:13, siko1056 <address@hidden> wrote:
> Dear Lester,
>
> Yes this behavior of fzero, passing extra arguments, in Matlab is known [1],
> e.g. Matlab allows:
>
> mysin = @(x,a,b) a*sin(x)+b
> fzero (mysin, 1, [], 2, 0.2)
>
> Octave doesn't. Matlab still supports this behavior maybe for legacy reason,
> but does not document this and recommends using other methods [2], that
> Octave supports as well. For your Example:
>
> allequ2 = @(x) allequ(x,Y1(j,i),zb(j),zt(j),surpor(j),c(j));
> yy = fzero(allequ2,Y2(j,i),options);
>
> HTH, Kai
>
>
> [1]
> http://octave.1599824.n4.nabble.com/passing-parameters-to-fzero-fsolve-td1637028.html
> [2] https://www.mathworks.com/help/matlab/ref/fzero.html#inputarg_fun
>
>
>
> --
> View this message in context: http://octave.1599824.n4.nabble.com/no-subject-tp4677559p4677590.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave



--
DASCertificate for 206392





--
DASCertificate for 206392


reply via email to

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