1

I'm not very good at programming and new to matlab, so sorry if I'm not using the right terminology.

If I use the e.g. fminbnd procedure in Matlab first i get the x-value which minimises and then i get the function value. Is there a neat way for me to get just the minimum function value. To make it clear, for me it seems I have to do:

[x,y] = fminbnd(h,-10,10)

when I only need y. Is there any way for me to not get x?

htd
  • 311
  • 1
  • 5
  • 15

1 Answers1

3

Use ~ to suppress x output. Only available in later versions of matlab (=> r2009b).

[~, y] = fminbnd(h, -10, 10); 
Nick
  • 3,143
  • 20
  • 34
  • Thanks a bunch! What now if I want -y? Do you know if i can get that directly (I'm maximising by minimising minus the function.). – htd Sep 02 '13 at 08:07
  • 3
    @Henrik I don't think you can assign to `-y` in general. However, you can of course simply use `-y` in later formulas, or do `y = -y` right after finding it. – Dennis Jaheruddin Sep 02 '13 at 08:17