MATLAB How to Plot a 3D Minimization Function in MATLAB?

Click For Summary
To create a 3D graph in MATLAB for the function y=fminbnd(@(x) wei(x,shape,scale,tw,tf),x0,x1), clarification is needed regarding the dimensionality of the output y. The discussion highlights that y is derived from a single-variable optimization, which typically results in a 1-D relationship, suggesting that a standard 2D plot could suffice. However, to achieve a 3D representation involving shape and scale, it is crucial to determine if y is a 3-D array or a 1-D vector. The command "whos y" can provide insights into the structure of y, indicating whether it can be plotted in three dimensions alongside shape and scale. Understanding the output format of y is essential for accurately plotting the desired 3D graph.
ericdavid
Messages
9
Reaction score
0
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!
 
Physics news on Phys.org
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?
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K