Is it possible to plot a function T(x,y,z,t), or even just T(x,y,z)?

want to plot a function T(x,y,z,t) for a x=0:pi, y=0:pi, z=0:pi, and some t=0:... Is this possible? Im trying to show heat heat dissipation in a 3D cube over time.

 Akzeptierte Antwort

Matt Kindig
Matt Kindig am 11 Okt. 2012
Sure, the easiest way is to represent the T value using color, using scatter3 (for discrete data), or patch/surf (for continuous data, like a function). You can further use transparency to show a fifth dimension (by modifying the 'AlphaData' property of the points), although this might be too difficult to read.
doc scatter3
doc surf

1 Kommentar

Ok, I'm very "new" to matlab (Used it as the basis for a numerical class).
This is what I came up with before getting lots of errors :(.
clc; clear all; close all
k=46; %conductivity
rho=3970; %material density
cp=765; %specific heat
x=0:pi; y=0:pi; z=0:pi; t=0:10;
T=@(x,y,z,t) (128/(pi^3)*sin(x).*sin(y).*cos(0.5*z).*exp((-2.25*k*t)/(rho*cp))-(128/(45*pi^3)*sin(3*x).*sin(3*y).*cos(1.5*z).*exp((-20.25*k*t)/(rho*cp))-(128/(525*pi^3)*sin(5*x).*sin(5*y).*cos(2.5*z).*exp((-56.25*k*t)/(rho*cp))-(128/(2205*pi^3)*sin(7*x).*sin(7*y).*cos(3.5*z).*exp((-110.25*k*t)/(rho*cp))))));
plot(x,y,z,t,T);
So you're saying using patch/surf for this? The long T function you see there is the first four terms of an infinite sum, but it should be a good approximation of the temperature distribution. Like, I said, I'm newer to matlab, and I looked online for help but couldnt get anything to work :(. Thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by