Filter löschen
Filter löschen

Waterfall plot of an integral

2 Ansichten (letzte 30 Tage)
Andrew Heinrich
Andrew Heinrich am 11 Feb. 2019
Beantwortet: Raghav Singhal am 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)

Antworten (1)

Raghav Singhal
Raghav Singhal am 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.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by