MATLAB: How to plot Error function of complex numbers error function of complex numbers plotno attempt Dear sir how have plotted for complex function taking omega=pi/2, M=0.5 Best Answer Hi Harekrishna Mandalthis is John BG <mailto:jgb2012@sky.com jgb2012@sky.com>Although MATLAB standard functions erf and erfc only work with real inputs, there is the MATLAB implementation of erfc(z) z Complex, by S. Abrarov, available herehttps://uk.mathworks.com/matlabcentral/fileexchange/47801-the-voigt-complex-error-function--second-version-?s_tid=srchtitlefadf.m Attached to this answer for convenience.I reach the following plots for a time interval of [0 10] dt=0.01 and sample theta=1clear all;close all;clc;M=.4;w=pi/2;dt=0.01;t1=0;t2=10;t=[t1:dt:t2]; theta=1; % sample valuep7_1=.25*exp(-1j*w*t)*exp(theta*(M-1j*w)^.5).*fadf((M-1j*w).^.5+.5*theta./(t).^.5);p7_2=.25*exp(-1j*w*t)*exp(-theta*(M-1j*w)^.5).*fadf(-(M-1j*w).^.5+.5*theta./(t).^.5);p7_3=.25*exp(1j*w*t)*exp(theta*(M+1j*w)^.5).*fadf((M+1j*w).^.5+.5*theta./(t).^.5);p7_4=.25*exp(1j*w*t)*exp(-theta*(M+1j*w)^.5).*fadf(-(M+1j*w).^.5+.5*theta./(t).^.5);p7=p7_1+p7_2+p7_3+p7_4;abs_p7=abs(p7);arg_p7=angle(p7);re_p7=real(p7);im_p7=imag(p7);figure(1);plot(t,abs_p7,t,arg_p7);grid on;legend('|p7|','ang(p7)');figure(2);plot(t,re_p7,t,im_p7);grid on;legend('re(p7)','im(p7)');...if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote linkthanks in advanceJohn BG<mailto:jgb2012@sky.com jgb2012@sky.com> Related SolutionsMATLAB: Erfc with complex number A quick search of the FEX turned up these two. There may be others...File 1File 2 MATLAB: How to find the differential equation ? ode solver If the output plot function is f(t) and f(t0)=f0, then the corresponding ODE reads dy/dt = f'(t) with y(t0) = f0.This ODE should reproduce y = f.Best wishesTorsten. Related QuestionHow to make the vectors the same lenght to plot ? plot (t,z)Plotting error: I am trying to plot the equations and the output should be as shown but its notODE function – plot not as desiredHow to find symbolic solution for theta1
Best Answer