Why is the interp1 function is returning all zeros? I try to interpolate excell data.

4 Ansichten (letzte 30 Tage)
able1 = xlsread ('TTB_Table_1_digitized');
Table6 = xlsread('TTB_Table_6_digitized');
Proof = Table6 (:,1);
SGair = Table6 (:,4);
Achol = Table6 (:,2);
SGV = Table6(:,5);
alpha = 25*10^-6;
DensityWater = 0.99904;
Tempex1 =[24 25 25 25.6 25.2 24.2 24.1 24.1];
% calcuating C2 by using the interpolstion function.
for i = length(SGair)
C(i) = interp1(Proof,SGV,SGair(i));
end
for i = length(C)
SG(i) = C(i)/DensityWater;
end
  1 Kommentar
Walter Roberson
Walter Roberson am 24 Feb. 2018
We don't know -- we have no information on the range of data that you are interpolating.
Note:
for i = length(SGair)
C(i) = interp1(Proof,SGV,SGair(i));
end
can be replaced by
C = interp1(Proof, SGV, SGair);

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by