[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem interpreting Matlab code
From: |
Terry Duell |
Subject: |
Problem interpreting Matlab code |
Date: |
Thu, 26 May 2011 12:30:40 +1000 |
User-agent: |
Opera Mail/11.11 (Linux) |
Hullo All,
I am trying to port some Matlab code to Octave, and have a problem that is
a bit beyond my knowledge.
The original Matlab code
--------------------
% conjugate gradient
x = minres(@compute_Ax_kernelEst,b(:),1e-4,maxiters,[],[],K(:),ang,
stdnoise,filts, h, w, numSampOrientation);
...
function Ax = compute_Ax_kernelEst(K,ang, stdnoise,filts, h, w,
numSampOrientation)
-------------------
I found a minres function, which, on the surface looked pretty much like
the Matlab minres doc description;
function [x,flag,relres,itn,resvec] = minres(A,b,rtol,maxit)
but this all caused Octave to throw an error re the function handle being
passed to minres.
I have tried to interpret how to best implement this in Octave and tried
the following;
%TLD changes to avoid passing handle to minres
ATLDx = compute_Ax_kernelEst(K(:),ang, stdnoise,filts, h, w,
numSampOrientation);
% conjugate gradient
%was x = minres(@compute_Ax_kernelEst,b(:),1e-4,maxiters,[],[],K(:),ang,
stdnoise,filts, h, w, numSampOrientation);
[x,flag,relres,itn,resvec] = minres(ATLDx,b(:),1e-4,maxiters);
but this now causes errors in minres.
Can anyone please say if my work-around to avoid passing the function
handle makes sense?
Of course there may be other issues with the minres code, but at this
stage I'm not sure where I should be looking for the problem.
Cheers,
--
Regards,
Terry Duell
- Problem interpreting Matlab code,
Terry Duell <=