Help with Matlab 3D Plots - F(i,j,k)=1

In summary, the person is trying to plot a 3D graph of a function and wants to plot three variables corresponding to the function when it equals 1. They have tried using the surf function, but it did not work. They are now looking for alternative ways to plot the function and have found that the isosurface function may work for their problem. Despite the function never precisely equaling 1, the isosurface function still works. The person is unsure why this is the case but is grateful for the suggestion.
  • #1
jenga42
12
0
Hi,

I'm trying to plot a 3d graph of when a function, F(i,j,k) = 1 ...I want to plot 3 variables that correspond to the i j and k against each other when the function equals 1.

...I've tried using surf but it tells me that its Z component needs to be a matrix, not a scalar or vector.. but I don't know how else to do it.

Any help would be greatly appreciated!

Thanks!
 
Physics news on Phys.org
  • #2
jenga42 said:
Hi,

I'm trying to plot a 3d graph of when a function, F(i,j,k) = 1 ...I want to plot 3 variables that correspond to the i j and k against each other when the function equals 1.

...I've tried using surf but it tells me that its Z component needs to be a matrix, not a scalar or vector.. but I don't know how else to do it.

Any help would be greatly appreciated!

Thanks!
It sounds like you're trying to display the [tex]F(i,j,k) = 1[/tex] isosurface. The correct MATLAB function to use would be isosurface, so you may want to look up that function in MATLAB's help system to see how to use it correctly for your problem.
 
  • #3
Hi,

Thanks for your reply. Unfortunately, I don't think the isosurface function will work in my case as although I want to plot when F(i,j,k)=1, the function never precisely equals 1: I'll need to plot something like 0.99<F(i,j,k)<1.01.

Any other suggestions would be greatly appreciated!

Thanks
 
  • #4
Actually I tried it just incase, and it works! ...Though I'm not really sure why! - Does isosurface estimate the values corresponding to i, j and k where F(i,j,k)=1?- Thank you!
 

1. How do I create a 3D plot in Matlab?

To create a 3D plot in Matlab, you can use the "plot3" function. This function takes in three vectors as input, representing the x, y, and z coordinates of your data points. You can also customize your plot by adding labels, titles, and adjusting the viewing angle.

2. What does the F(i,j,k)=1 notation mean in Matlab?

In Matlab, F(i,j,k)=1 is a way of defining a 3D matrix with the value of 1 at the (i,j,k)th position. This notation is commonly used when working with multidimensional arrays in Matlab.

3. Can I plot multiple 3D plots in one figure in Matlab?

Yes, you can plot multiple 3D plots in one figure in Matlab by using the "hold on" function. This will allow you to plot multiple graphs on the same figure without overwriting the previous one.

4. How can I change the color or style of my 3D plot in Matlab?

To change the color or style of your 3D plot in Matlab, you can use the "color" and "linestyle" options in the "plot3" function. These options allow you to customize the appearance of your plot, such as changing the line color, thickness, and adding markers.

5. Is it possible to add a legend to a 3D plot in Matlab?

Yes, you can add a legend to a 3D plot in Matlab by using the "legend" function. You can specify the labels for each plot in the legend and also customize its location and appearance.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
984
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top