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

  • Home
  • SEARCH
  • 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 8133113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:30:46+00:00 2026-06-06T09:30:46+00:00

I want to solve the following optimization problem: Non-Latex: Given x and mu, find

  • 0

I want to solve the following optimization problem:

Non-Latex: Given x and mu, find

argmin_p ||x-p||_2 s.t. ||p||_2 < mu.

Latex:

Given $\mathbf{x}$ and $\mu$, find

$\mathrm{argmin}_p \|\mathbf{x}-\mathbf{p}\|_2 \;\; \mathrm{s.t.}\;\;\|\mathbf{p}\|_2 \leq \mu$,

which is a convex function over a convex set. I have been using Matlab’s fmincon but it is just too slow. Search engine results have so far brought me material that is much more theoretical than what I am looking for. I can’t be the first person to want to solve this problem and was hoping to find an existing and efficient Matlab implementation.

  • 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-06T09:30:49+00:00Added an answer on June 6, 2026 at 9:30 am

    cvx can handle this problem quite simply. Even if you’re not familiar with it, the syntax is quite intuitive:

    % test data
    n = 1e4;
    x = randn(n,1);
    mu = 1;
    
    cvx_begin
    variable p(n)
    minimize norm(x-p)
    subject to
    norm(p) <= mu
    cvx_end
    

    On my system this takes under a second for 10^4 variables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a following problem I want to solve efficiently. I am given a
I have the following problem that I want to solve in awk. I have
How can i solve the following (simplified) problem? M-V-VM context. I want to show
I'm trying to use STL to solve the following problem (I don't want to
I'm looking for a relatively efficient function to solve the following problem: Given records
I have a following problem I want to solve ellegantly: public interface IMyclass {
I wonder how to solve the following problem: I want to get access to
I want to solve the following problem, it's about deleting entities from a database:
does anyone know how I can solve the following problem. I want to return
I'm looking for a pattern to solve the following problem, which I imagine is

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.