Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Interpolation based on data points

1 Ansicht (letzte 30 Tage)
Tigist Beyene
Tigist Beyene am 23 Feb. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I wanted to do the derivative of the density based on the data below . My code returns only the
last value. I don't know why. Besdies I am not sure wether I have done it correctly. Thanks for the help.
function [rho, N]=density(z)
zval= [2 3 5 7 10 15 20 25];
rho1 = [17.2731684 17.1649375 21.43455647 22.4140625 23.86332207 24.3746967 24.70487685 24.6003125];
zvala=400-zval;
zvalue=fliplr(zvala);
rho2=fliplr(rho1);
rho3=smoothdata(rho2,'lowess',6);
rho=interp1(zvalue,rho3,z);
rho4=interp1(zvalue,rho3,z+0.1);
N=rho4-rho % drho /dz
end

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by