MATLAB: Colormap of the difference between a function Q(x,y) and a constant C in the (x,y)-plane 2d plotcolormapmathematicsplotting Here we have So, I want the colormap for the difference C-Q(x,y) in the x,y-planes and map out the regions where C=Q(x,y), C<Q(x,y), and C>Q(x,y) Best Answer I am helping you for a major part. Rest you need to follow up .m = 100 ; n = 100 ;x = linspace(0,0.01,m) ;y = linspace(0,0.01,n) ;[X,Y] = meshgrid(x,y) ;L = 0.81*10^-3 ;C = 16.3 ;N = 10000 ;Q = zeros(m,n) ;for i = 1:N vn = ((2*i-1)/2*L)^2*pi^2 ; A = -vn*X./(1+vn*Y) ; Q = Q+1/vn*(1-exp(A)) ;endQ = 2./X.*Q ;pcolor(X,Y,Q) ;shading interp ;colorbarCheck the code thoroughly, before using. Related SolutionsMATLAB: How to write Continue Long Statements on Multiple Lines Use repmat to avoid manually typing all 160 of those ‘%q’ repeats! Try this: formatSpec = ['%f',repmat('%q',1,160), '%[^\n\r]']; MATLAB: Dear friends, the long matlab command that I have written is error. I want to be spelled the same way but without error. Do it like the second example on this documentation page about continuing long statements on multiple lines. Related QuestionThe headerlines are not always properly detected by readtableHow to create a contour map with the data coordinat and data elevationHow to write Continue Long Statements on Multiple LinesTrying to code a tricky double summation
Best Answer