Borrar filtros
Borrar filtros

Waterfall plot of an integral

2 visualizaciones (últimos 30 días)
Andrew Heinrich
Andrew Heinrich el 11 de Feb. de 2019
Respondida: Raghav Singhal el 27 de Feb. de 2019
I am attempting to create a waterfall plot of an integrated function where one of the bounds is a variable. I am very new to matlab so I am not sure if the answer is glaringly obvious, but trying different things gets me different errors, either with horzcat or with non-numeric inputs for the waterfall command. Any advice is appreciated.
x = linspace(-3,3,20);
y = linspace(.01,1,20);
T= linspace(0,1,20);
[X,Y]= meshgrid(x,y);
f = (4.*pi.*(Y-T)).^-1/2.*exp(-X.^2./(4.*(Y-T)));
syms T Y
Z= int(f,T,[0 Y]);
figure
waterfall(X,Y,Z)

Respuestas (1)

Raghav Singhal
Raghav Singhal el 27 de Feb. de 2019
Hi, the expression 'f' you have defined is of type double, ie it has no variables and hence integrating such an expression wouldnt work. You could try defining the variables used as symbolic beforehand and try. Additionally since you seem to be integrating an expression with three variables, you could try using 'integral3' instead of 'int'.
Doucumentation for the same can be found here. Hope this helps.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by