1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Matlab 3d plotting

  1. Dec 27, 2009 #1
    how can i plot this function with matlab in the region restricted between y=-2x and x=0 lines?

    i wanted to plot that the second region of the cartesian coordinate
    y=-2*x+eps , eps is very small

    but it is not what i want.is there another way to plot this?
  2. jcsd
  3. Dec 27, 2009 #2
    Why so hard? Just plot regular, then remove the region you don't want

    Edit: What I mean is, you can create masks and use them to selectively crop out undesirable portions of your graph (e.g. the singularities that occur along the y=-2x line) Note that your viewport will still be rectangular

    x = -2:0.1:2;
    y = -2:0.1:2;
    [X,Y] = meshgrid(x,y);
    Mu = X < 0;
    Ml = Y > -2*X;

    Hope this helps.
    Last edited: Dec 27, 2009
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Matlab plotting Date
Plotting with Matlab Feb 18, 2017
Find Fourier transform and plot spectrum by hand & MATLAB Dec 1, 2016
Plotting in Matlab Nov 12, 2016
Matlab plotting Jun 8, 2016
MATLAB question ( plot) Mar 6, 2016