[Top][All Lists]

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

Re: Help in parameter estimation

From: Nicholas Jankowski
Subject: Re: Help in parameter estimation
Date: Tue, 30 Aug 2016 10:01:24 -0400

On Tue, Aug 30, 2016 at 6:00 AM, Bharath R <address@hidden> wrote:
function m=f(x,p)
  for i=1:length(x)

is your intent to return the variable m or the variable mat from function f? you are currently returning m and never using mat. since mat is a different size than m, this could make a significant difference when you use the results of f later.

your declaration for m is odd. it asks to make all of the columns in row1 equal to 20.  since m has not yet been initialized, the number of rows is 1. so the output is a 1x1 array, or a scalar, and m = 20. then in the for loop, if the result of the m(i+1,:) equation was 6, you would be appending it as a new row to m, creating a 2x1 array [20 ; 6] . Since you went to the trouble of using the : operator, but have it doing nothing, I suspect this was not your intent?

reply via email to

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