add / interpolate arrays of different length
Hello community,
i have two array’s tsol and ysol. Each array has the length of 9;
I have also an error estimate array errorEst. The error estimate has only 4 elements.
The four elements have a "time" length of 0.25.
The errorEst
tsol = linspace(0,1,9);
ysol = sin(tsol*pi);
errorEst = rand(1,4); %each bar has a length of 0.25;
bar(errorEst);
plot([0 0.25 0.5 0.75; 0.25 0.5 0.75 1],[errorEst; errorEst]/0.25,’k’)
title(‘gradient of errorEst ‘)
xlabel(‘t’)
ylabel(‘d errorEst / dt’)
% who could i integrate this gradient of errorEst w.r.t the time tSol and
% add to ysol?
% the first part should be a continous (function/plot)
% is there an elegant solution, which is parallelizable?
the solution should be plottet:
%yp = ysol + errorEstLin;
%ym= ysol -errorEstLin;Hello community,
i have two array’s tsol and ysol. Each array has the length of 9;
I have also an error estimate array errorEst. The error estimate has only 4 elements.
The four elements have a "time" length of 0.25.
The errorEst
tsol = linspace(0,1,9);
ysol = sin(tsol*pi);
errorEst = rand(1,4); %each bar has a length of 0.25;
bar(errorEst);
plot([0 0.25 0.5 0.75; 0.25 0.5 0.75 1],[errorEst; errorEst]/0.25,’k’)
title(‘gradient of errorEst ‘)
xlabel(‘t’)
ylabel(‘d errorEst / dt’)
% who could i integrate this gradient of errorEst w.r.t the time tSol and
% add to ysol?
% the first part should be a continous (function/plot)
% is there an elegant solution, which is parallelizable?
the solution should be plottet:
%yp = ysol + errorEstLin;
%ym= ysol -errorEstLin; Hello community,
i have two array’s tsol and ysol. Each array has the length of 9;
I have also an error estimate array errorEst. The error estimate has only 4 elements.
The four elements have a "time" length of 0.25.
The errorEst
tsol = linspace(0,1,9);
ysol = sin(tsol*pi);
errorEst = rand(1,4); %each bar has a length of 0.25;
bar(errorEst);
plot([0 0.25 0.5 0.75; 0.25 0.5 0.75 1],[errorEst; errorEst]/0.25,’k’)
title(‘gradient of errorEst ‘)
xlabel(‘t’)
ylabel(‘d errorEst / dt’)
% who could i integrate this gradient of errorEst w.r.t the time tSol and
% add to ysol?
% the first part should be a continous (function/plot)
% is there an elegant solution, which is parallelizable?
the solution should be plottet:
%yp = ysol + errorEstLin;
%ym= ysol -errorEstLin; interpolate MATLAB Answers — New Questions