Results 1 to 2 of 2

Math Help - Matlab: Syntax error in arguments to LM-function???

  1. #1
    Junior Member
    Joined
    Sep 2006
    Posts
    44

    Unhappy Matlab: Syntax error in arguments to LM-function???

    I'm not very used to Matlab yet, and I suspect I'm doing a silly error with formating arguments for a Levenberg-Marquart function I want to use.

    For the leasqr.m function [f,p,kvg,iter,corp,covp,covr,stdresid,Z,r2]= ...
    leasqr(x,y,pin,F,stol,niter,wt,dp,dFdp,options)
    I write:
    leasqr([113,170,289,399,535,609,645],[210,143,89,79,12,162,206],{'ay','cy','ax','cx'},'y=f(cy-(ay*(ax*ax-(cx-x)^2)^(1/2))/ax)',0.1,10)

    and get:
    ??? Function 'mtimes' is not defined for values of class 'cell'.

    For the lma.m function[a,sd_a,var,covar,chisq] = lma(x,y,sig,a,funktion,parameter,accuracy,verbose) I write:
    lma([113,170,289,399,535,609,645],[210,143,89,79,12,162,206],1,[100,300,200,400],'cy-(ay*(ax*ax-(cx-x)^2)^(1/2))/ax',{'ay','cy','ax','cx'})

    and get:
    ??? Attempted to access g(2); index out of bounds because numel(g)=1.

    I've tried different ,;[{('" signs to no avail. It seems it becomes "cells" or lacks elements.

    Any ideas about the syntax?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Optiminimal View Post
    I'm not very used to Matlab yet, and I suspect I'm doing a silly error with formating arguments for a Levenberg-Marquart function I want to use.

    For the leasqr.m function [f,p,kvg,iter,corp,covp,covr,stdresid,Z,r2]= ...
    leasqr(x,y,pin,F,stol,niter,wt,dp,dFdp,options)
    I write:
    leasqr([113,170,289,399,535,609,645],[210,143,89,79,12,162,206],{'ay','cy','ax','cx'},'y=f(cy-(ay*(ax*ax-(cx-x)^2)^(1/2))/ax)',0.1,10)

    and get:
    ??? Function 'mtimes' is not defined for values of class 'cell'.
    I havn't got a working version of Matlab with the optimisation tool box
    available to test this but try:

    leasqr([113,170,289,399,535,609,645],[210,143,89,79,12,162,206],[0,0.1,0,1],'y=f(p(2)-(p(1)*(p(3)*p(3)-(p(4)-x)^2)^(1/2))/p(3))',0.1,10)

    The parameters should be in an array p, pin is the initial guess.

    RonL
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab Numerical Integration - Syntax/Style Query
    Posted in the Math Software Forum
    Replies: 2
    Last Post: March 9th 2010, 07:35 AM
  2. Help needed in Syntax writing in MATLAB
    Posted in the Math Software Forum
    Replies: 4
    Last Post: March 2nd 2010, 10:49 PM
  3. Matlab counting syntax problem
    Posted in the Math Software Forum
    Replies: 3
    Last Post: October 23rd 2009, 06:25 AM
  4. syntax error
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: August 27th 2009, 06:00 AM
  5. Vector function of two arguments
    Posted in the Calculus Forum
    Replies: 2
    Last Post: October 13th 2008, 04:54 PM

Search Tags


/mathhelpforum @mathhelpforum