Azzera filtri
Azzera filtri

Waterfall plot of an integral

2 visualizzazioni (ultimi 30 giorni)
Andrew Heinrich
Andrew Heinrich il 11 Feb 2019
Risposto: Raghav Singhal il 27 Feb 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)

Risposte (1)

Raghav Singhal
Raghav Singhal il 27 Feb 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.

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by