Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab Plotting graph 3D minimization

  1. Nov 3, 2016 #1
    Hi to everyone,

    I'm trying to plot a 3D graph on matlab but I do not know how.
    The function that I want to plot is: y=fminbnd(@(x) wei(x,shape,scale,tw,tf),x0,x1).
    I would like to plot the minimization of the function wei (y) in function of the shape and the scale.
    Wei is a function that I have created and only has one output.
    Tw and tf are known parameters, and x0, x1 the range where I want to optimize the function, as well known.

    To sum up, I want to plot y, shape and scale in the same graph.

    Thanks!
     
  2. jcsd
  3. Nov 3, 2016 #2
    How is this a 3D graph? You have y as a function of a single variable, x. That makes it a 1-D relationship which can be plotted with a regular function like plot(). Now, I've never used fminbnd() nor wei(). When you run this, is y a 3D array, with 3 indexes instead of only 1? What does

    whos y

    report to the command window? Is y a 1-D vector, or a 3-D array?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted