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 8452295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:27:46+00:00 2026-06-10T11:27:46+00:00

Using matlab’s FILL function creates a filled region confined by a polygon with straight

  • 0

Using matlab’s FILL function creates a filled region confined by a polygon with straight edges:

enter image description here

Unfortunately this leaves a small white region in the figure above, because the boundary of the region I want filled in is not a straight-edged polygon, but rather has a curved boundary on the left side. I have a curve (nearly parabolic but not exactly), and I want to fill in the region between two horizontal lines AND the curve itself. I also looked into the MATLAB function IMFILL, but with no luck.

  • 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-10T11:27:47+00:00Added an answer on June 10, 2026 at 11:27 am

    What you need to do is make a polygon with more corners, so that it fits the curve more smoothly:

    %# create a parabola and two straight lines
    x = -3:0.1:3;
    y = x.^2/4;
    plot(x,y)
    hold on, plot([-3 3],[1 1],'r',[-3 3],[2 2],'r')
    
    %# create a polygon that hugs the parabola
    %# note that we need to interpolate separately
    %# for positive and negative x
    x1 = interp1(y(x<0),x(x<0),1:0.1:2);
    %# interpolate in reverse so that the corners are properly ordered
    x2 = interp1(y(x>0),x(x>0),2:-0.1:1);
    
    %# fill the area bounded by the three lines
    fill([x1,x2],[1:0.1:2,2:-0.1:1],'g')
    

    enter image description here

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

Sidebar

Related Questions

I am using Matlab and am using its solve function. I run this code
Using MATLAB, I have this code: value = input('>> Enter a value: '); and
I am using matlab's randn function to generate random random numbers from a standard
I am creating an Excel using the Matlab xlswrite function. How can I change
I'm Using MATLAB R2010a I used this this tutorial in order to call matlab
I am trying to draw 256 small sized squares using MATLAB rectangle function. If
While using MATLAB 2D filter funcion filter2(B,X) and convolution function conv(X,B,'') , I see
When using MATLAB's lsqnonlin function, I am trying to give a user-defined Jacobian matrix,
I'm using MATLAB and am calling a function that returns properties of the screen.
I am drawing dendrogram using matlab function like the following [h1,t1,perm1] = dendrogram(z,3); According

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.