help-octave
[Top][All Lists]

## [no subject]

 From: Lester Anderson Subject: Date: Thu, 9 Jun 2016 14:04:20 +0100

```Hello,

I have got the following error message generated as a function of some code:

warning: called from
print_usage at line 54 column 16
fzero at line 112 column 5
decomp at line 61 column 12
error: Invalid call to fzero.  Correct usage is:

-- Function File: fzero (FUN, X0)
-- Function File: fzero (FUN, X0, OPTIONS)
-- Function File: [X, FVAL, INFO, OUTPUT] = fzero (...)

The code snippet:

% setup initial Y1 and Y2 matrices

for i = 1:size(c,1)
for j = i:-1:1
if j == i
Y1(j,i) = 0;
Y2(j,i) = zb(j) - zt(j);
else
Y1(j,i) = Y2(j+1,i);
Y2(j,i) = zb(j) - zt(j) + Y1(j,i);
end
end
end
% solve equation 8.23 in Allen and Allen

set(canvas,'Pointer','watch');

for i = 1:size(c,1)
for j = i:-1:1
if j == i
Y1(j,i) = 0;
else
Y1(j,i) = Y2(j+1,i);
end
options=optimset('display','off');
yy = fzero('allequ',Y2(j,i),options,Y1(j,i),zb(j),zt(j),surpor(j),c(j));
Y2(j,i) = yy;
end
end

It is using the existing function file allequ.m. The main code runs a
gui (public domain Matlab code) and that seems to work with a figure
window generated and the menu options available etc.

Is the syntax for yy not reading the separate .m file?

Any pointers to try would be great.

Lester

```