From: Susana on
Hi,

I'm working with MatLab since just 2 months and I need to do a Steepest Descent in my data. The problem is that my data is not a function, but a Matrix (MAT-file).
And all the help that I found is to functions....
Some idea??

Thanks in advance,

Susana
From: Matt J on
"Susana " <santosusana(a)iol.pt> wrote in message <i1ni7g$81d$1(a)fred.mathworks.com>...
> Hi,
>
> I'm working with MatLab since just 2 months and I need to do a Steepest Descent in my data. The problem is that my data is not a function, but a Matrix (MAT-file).
========

You need to clarify what "my data is not a function" means. When is data ever a function?

If you mean that you are minimizing over the values in a matrix stored in a .mat file, just use min() on that matrix.
From: Morgan Fox on
"Susana " <santosusana(a)iol.pt> wrote in message <i1ni7g$81d$1(a)fred.mathworks.com>...
> Hi,
>
> I'm working with MatLab since just 2 months and I need to do a Steepest Descent in my data. The problem is that my data is not a function, but a Matrix (MAT-file).
> And all the help that I found is to functions....
> Some idea??
>
> Thanks in advance,
>
> Susana

So you have a matrix of data and you're trying to find the two points which have the greatest negative difference? Something like this might work, where a is a vector of data.

for i=1:length(a)-1
out(i)=a(i+1)-a(i);
end

ans1=out-max(out) ;
ans2=find(ans1==0)
From: Andy on
Actually, there is a built in function to take sequential differences of a vector.

a = rand([1 10]); %your data
b = diff(a);
SD = min(b);
From: James Allison on
You could fit a response surface (like a polynomial or neural network)
to your data. This response surface can be put in the form of an
objective function as required by MATLAB optimization algorithms, and
then use an unconstrained optimization algorithm (e.g., fminunc) to find
the minimum of this surface. The solution will approximate the minimum
of the actual system that generated the data.

If you have the ability to gather more data, you can improve the
accuracy of the solution by resampling in a tighter region near the
optimum of the response surface, fitting a new surface using the new
data, and performing the optimization again on the updated surface. This
"successive surrogate modeling" approach can be iterated with
increasingly tight sampling regions to improve accuracy further.

-James

Susana wrote:
> Hi,
>
> I'm working with MatLab since just 2 months and I need to do a Steepest
> Descent in my data. The problem is that my data is not a function, but a
> Matrix (MAT-file).
> And all the help that I found is to functions....
> Some idea??
> Thanks in advance,
>
> Susana