Godelproof Matlab 3D Plot question

In summary, the conversation discusses how to draw a surface on the domain [0,1]^3 with the conditions z=x for x>=y and z=y for y>x. The use of "meshgrid" and "surface" commands is mentioned, but it is uncertain how to incorporate the inequalities. The provided FreeMat code in Matlab is used as an example for achieving the desired result.
  • #1
CaptainBlack
807
0
godelproof said:
I want to draw this surface on \([0,1]^3\):

\(z=x\) for \(x\geq y\) and \(z=y\) for \(y>x\)
I know "meshgrid" coupled with "surface" command allows you to draw \(z=x\) and \(z=y\), respectively. But I have no idea how to account for the inequalities.
Thanks.

The following is FreeMat code, but it should get you close enough in pure Matlab:

Code:
--> x=[0:0.1:1];
--> [X,Y]=meshgrid(x);
--> Z=X.*(X>=Y)+Y.*(X<Y);
--> surf(X,Y,Z);

CB
 
Last edited:
Physics news on Phys.org
  • #2
:x = 0:0.1:1; [X,Y] = meshgrid(x); Z = zeros(size(X)); idx = X>=Y;Z(idx) = X(idx);Z(~idx) = Y(~idx); surf(X,Y,Z)
 

FAQ: Godelproof Matlab 3D Plot question

Can I use Godelproof Matlab to create a 3D plot?

Yes, Godelproof Matlab is a software that allows you to create 3D plots and visualizations.

Is Godelproof Matlab easy to use for beginners?

Godelproof Matlab is designed for both beginners and experienced users. It has a user-friendly interface and provides tutorials and documentation to help beginners get started.

What types of data can be plotted using Godelproof Matlab?

Godelproof Matlab can plot various types of data, including numerical, categorical, and time series data. It also supports plotting functions and equations.

Can Godelproof Matlab create interactive 3D plots?

Yes, Godelproof Matlab allows you to create interactive 3D plots that can be rotated, zoomed, and customized. This can help you analyze and understand your data better.

Is Godelproof Matlab compatible with other software or programming languages?

Godelproof Matlab is compatible with other software and programming languages, such as Python, Java, and C++. You can also import data from Excel, CSV, and other file formats into Godelproof Matlab for plotting.

Similar threads

Replies
2
Views
3K
Replies
2
Views
3K
Replies
1
Views
1K
Replies
11
Views
3K
Replies
2
Views
1K
Replies
4
Views
1K
Replies
1
Views
2K
Replies
1
Views
1K
Back
Top