Cody

Sajjad Hossain

933
Rank
6
Badges
1308
Score
51 – 100 of 115

Sajjad Hossain submitted a Comment to Problem 970. Piecewise linear interpolation

function out=tracers(x,y) out=zeros(sum(y)-(length(y)-1),2); [c d]=size(x); [a b]=size(y); k=0; out(1:y(1),1)=linspace(x(1),x(1+1),y(1)); out(1:y(1),2)=linspace(x(1+c),x(1+1+c),y(1)); for i=1:(b-1) out(y(i)+k:(y(i)+y(i+1)+k-1),1)=linspace(x(i+1),x(i+2),y(i+1)); out(y(i)+k:(y(i)+y(i+1)+k-1),2)=linspace(x(i+1+c),x(i+2+c),y(i+1)); k=y(i)-1; end % x is an Mx2 vector, and y is a row of M-1 numbers. % Tracers linearly interpolates y(1) points between x(1,:) and x(2,:), % followed by y(2) points between x(2,:) and x(3,:), and so on... % The resultant output is a two column vector with consecutive % duplicate points are removed. end

on 30 Sep 2020

Sajjad Hossain received Community Group Solver badge for Basics on Vectors

on 26 Sep 2020

Sajjad Hossain received Introduction to MATLAB Master badge

on 26 Sep 2020

51 – 100 of 115