Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7901211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:09:49+00:00 2026-06-03T09:09:49+00:00

Within my daily work, I have got to maximize a particular function making use

  • 0

Within my daily work, I have got to maximize a particular function making use of fminsearch; the code is:

clc
 clear all
 close all

 f = @(x,c,k) -(x(2)/c)^3*(((exp(-(x(1)/c)^k)-exp(-(x(2)/c)^k))/((x(2)/c)^k-(x(1)/c)^k))-exp(-(x(3)/c)^k))^2;
 c = 10.1;
 k = 2.3;
 X = fminsearch(@(x) f(x,c,k),[4,10,20]);

It works fine, as I expect, but not the issue is coming up: I need to bound x within certain limits, as:

 4 < x(1) < 5
 10 < x(2) < 15
20 < x(3) < 30

To achieve the proper results, I should use the optimization toolbox, that I unfortunately cannot hand.

Is there any way to get the same analysis by making use of only fminsearch?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:09:50+00:00Added an answer on June 3, 2026 at 9:09 am

    Well, not using fminsearch directly, but if you are willing to download fminsearchbnd from the file exchange, then yes. fminsearchbnd does a bound constrained minimization of a general objective function, as an overlay on fminsearch. It calls fminsearch for you, applying bounds to the problem.

    Essentially the idea is to transform your problem for you, in a way that your objective function sees as if it is solving a constrained problem. It is totally transparent. You call fminsearchbnd with a function, a starting point in the parameter space, and a set of lower and upper bounds.

    For example, minimizing the rosenbrock function returns a minimum at [1,1] by fminsearch. But if we apply purely lower bounds on the problem of 2 for each variable, then fminsearchbnd finds the bound constrained solution at [2,4].

    rosen = @(x) (1-x(1)).^2 + 105*(x(2)-x(1).^2).^2;
    
    fminsearch(rosen,[3 3])     % unconstrained
    ans =
       1.0000    1.0000
    
    fminsearchbnd(rosen,[3 3],[2 2],[])     % constrained
    ans =
       2.0000    4.0000
    

    If you have no constraints on a variable, then supply -inf or inf as the corresponding bound.

    fminsearchbnd(rosen,[3 3],[-inf 2],[])
    ans =
           1.4137            2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Within my application, I use the MiniDumpWriteDump function (see dbghelp.dll) to write a crash
This query returns the sum of closed daily sales for a particular salesperson within
Within our company we use a proprietary template engine, which stores its templates in
Within my HTML, I have a php script that includes a file. At that
Within my logic layer I have the need to check permissions for a wide
Within my service I have an mbean which is accessed by my war file.
Within our unit tests we use plain ADO.NET (DataTable, DataAdapter) for preparing the database
We have a few different websites running on the same server that all access
I use a standard user account for my daily tasks on Mac OS. Since
You often see, on sites like The Daily WTF , examples of overengineered code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.