Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Interpolation based on data points

1 visualizzazione (ultimi 30 giorni)
Tigist Beyene
Tigist Beyene il 23 Feb 2019
Chiuso: MATLAB Answer Bot il 20 Ago 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

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by