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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:32:53+00:00 2026-06-13T11:32:53+00:00

I want to plot a function y=1-exp(c) ,where as the range of x is

  • 0

I want to plot a function y=1-exp(c) ,where as the range of x is defined. The plot is to be between x and the function y. The plot just shows just 1 point instead of showing a series of points exponentially.I am new in Matlab.Sp,please help me where I am going wrong Here is the code:

   for x = -10:0.25:10

   if(x>0)

   c=-6*x;
   m=exp(c);
   y = 1-m  

   end
   plot(x,y,'o')
   xlabel('x') 
   ylabel('y') 
   title('Plot')
   end
  • 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-13T11:32:53+00:00Added an answer on June 13, 2026 at 11:32 am

    This should do it:

    x = -10:0.25:10; % define the x vector
    c=  -5*x.*(x>0); % using a  logical condition the 'if' is avoided
    y = 1-exp(c);    % calc y given c
    
    plot(x,y,'o')
    xlabel('x') 
    ylabel('y') 
    title('Plot')
    

    no ‘for’ loop or ‘if’ needed…

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

Sidebar

Related Questions

I have a data which I want to plot in cumulative function. The R
I want to create a function which plot on screen a set of figures
I want to plot several lists of points, each list has distance (decimal) and
I have a series of spectral data which I want to plot in a
I want to plot a series of lines with one half-space filled for each
I'm using qplot to plot a function and I want to position the legend
I have the following file I want to plot using gnuplot bar graphs: Function
I've got a scalar function of two variables that I want to plot. Using
I want to plot a 2d rect (using the rectangle function is good enough
I want to plot a function in a form without the forms background being

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.