How to present this equation for plotting

1 Ansicht (letzte 30 Tage)
JingChong Ning
JingChong Ning am 28 Jan. 2023
Beantwortet: Rik am 28 Jan. 2023
I have this equation:
that I need to input into matlab for plot into a surface. However, I am not sure whether I should use power or ^ for my equation. This is the rest of my code:
star = 2*pi;
x = 0:0.01:star; % define range and mesh of x and y which will be shown in figure
y = -1:0.01:1;
[X, Y] = meshgrid(x, y);
surf(X, Y, t(X,Y));

Antworten (1)

Rik
Rik am 28 Jan. 2023
You need either power or .^ (otherwise you perform a matrix power). So apart from that correction, either will work.
I would suggest using linspace to generate the base vectors x and y, but this works as well (although it does not guarantee the end-point to be 2*pi).
If you have trouble with implementing the rest of your function, just post a comment with what you have.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by