Matlab: Plotting error Analysis -
i have created function expresses ideal characteristics of concentration vs time , real characteristics of concentration vs time gaussian noise.
following curves of both ideal , real function
i plot error curve expresses difference between ideal , real values(with noise)
the characteristics must expressed in( noise - x axis vs error -y axis) instead of concentration vs time
following function generates 2 curves expressed above
function [c_t,c_t_noise] =noise_constrainedk2(t,a1,a2,a3,b1,b2,b3,td,tmax,k1,k2,k3) k_1 = (k1*k2)/(k2+k3); k_2 = (k1*k3)/(k2+k3); %dv_free= k1/(k2+k3); c_t = zeros(size(t)); ind = (t > td) & (t < tmax); c_t(ind)= conv(((t(ind) - td) ./ (tmax - td) * (a1 + a2 + a3)),(k_1*exp(-(k2+k3)*t(ind)+k_2)),'same'); ind = (t >= tmax); c_t(ind)=conv((a1 * exp(-b1 * (t(ind) - tmax))+ a2 * exp(-b2 * (t(ind) - tmax))) + a3 * exp(-b3 * (t(ind) - tmax)),(k_1*exp(-(k2+k3)*t(ind)+k_2)),'same'); mean=1:10 sigma=1:45 c_t_noise = c_t+normrnd(mean,sigma,[1 500],length(c_t)); end end dg = [0 0.5 0]; plot(t,c_t,'r'); hold on; plot(t,c_t_noise,'color',dg); hold off; axis([0 50 0 1900]); xlabel('time[mins]'); ylabel('concentration [mbq]'); title('my signal'); end
kindly suggest me way in can possibly compute difference between c_t , c_t_noise , plot it
Comments
Post a Comment