Hello everyone;
Need help in plotting all these three functions on a single graph.
U=nthroot(1-x^3-y^3-z^3,3)
V=nthroot(1-x^2-y^2-z^2, 2)
W=(1-x-y-z)
Thanks

5 Kommentare

What do you expect the output of these equations to look like? What does the following equation mean
U=nthroot(1-x^3-y^3-z^3,3)
Ke Le
Ke Le am 7 Jun. 2020
U , V and W are functions in variables x, y and z. I'd like the graph as a contour 3D plot or any other possible format.
KSSV
KSSV am 7 Jun. 2020
That we understood...but what does nth root does?
@kssv
doc nthroot
Ke Le
Ke Le am 7 Jun. 2020
nthroot(p, 2)----> squared root
nthroot(p, 3)---->cube root.
Or if not a problem one may write it as (p).^(1/3), right?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 7 Jun. 2020

0 Stimmen

Since you have 3 independent variables, you will need to use slice() and create 3 figures.
[X, Y, Z] = meshgrid(-0.5:0.02:0.5);
U = nthroot(1-X.^3-Y.^3-Z.^3, 3);
V = nthroot(1-X.^2-Y.^2-Z.^2, 2);
W = (1-X-Y-Z);
figure
slice(X, Y, Z, U, [-0.4 0 0.3], 0, 0.3)
title('U')
colorbar
shading interp
figure
slice(X, Y, Z, V, [-0.4 0 0.3], 0, 0.3)
title('V')
colorbar
shading interp
figure
slice(X, Y, Z, W, [-0.4 0 0.3], 0, 0.3)
title('W')
colorbar
shading interp

3 Kommentare

Ameer Hamza
Ameer Hamza am 8 Jun. 2020
Ali Khan's comment posted as answer moved here:
Seems ok. Is there any way to see there plots in a better way? I don't think one would be able to understand what these graphs say.
Ameer Hamza
Ameer Hamza am 8 Jun. 2020
I don't think there is any other useful way to visualize 4D data. If you have some other example, then you can show an image.
Ke Le
Ke Le am 8 Jun. 2020
[X,Y,Z] = meshgrid(0:1:1);
V = nthroot(1-X.^3-Y.^3-Z.^3,3);
[xsurf,ysurf] = meshgrid(0:.01:1);
zsurf = 1-xsurf.^3-ysurf.^3;
contourslice(X,Y,Z,V,xsurf,ysurf,zsurf,200, 'nearest')
view(3)
grid on

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

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

Gefragt:

am 7 Jun. 2020

Kommentiert:

am 8 Jun. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by