Matlab - Shade the surface between 2 vertical curves -


i'm trying (without success far) colorize or shade surface between 2 curves in vertical direction. more specifically, i'd shade surface between red , blue curves, knowing cross each others.

the final purpose of show domain of incertitude (the nominal curve black one), represented red , blue curves.

i don't know if can help, have each curve vector of 100 values. have idea on how ?

image

thanks lot,

best regards,

antoine

edit : quick answer !

i tried method doesn't seem work unfortunately..

here's code :

filename = '/users/antoine/dropbox/tfe/post-processing/100planes_z_ht/case1/ht_tip_int.dat'; delimiterin = ' '; case1_int = importdata(filename,delimiterin);  filename = '/users/antoine/dropbox/tfe/post-processing/100planes_z_ht/case4/ht_tip_int.dat'; delimiterin = ' '; case4_int = importdata(filename,delimiterin);  filename = '/users/antoine/dropbox/tfe/post-processing/100planes_z_ht/case5/ht_tip_int.dat'; delimiterin = ' '; case5_int = importdata(filename,delimiterin);  figure ht_tip_int1=plot(case1_int.data,z2,'k-','linewidth',1); hold on; ht_tip_int4=plot(case4_int.data,z2,'r'); ht_tip_int5=plot(case5_int.data,z2,'c');  area( [case4_int.data fliplr(case5_int.data)], [z2 fliplr(z2)],'facecolor','red'); hold off 

it right way ?

thanks !

antoine

how using area following way:

take first dataset , it's argument vector, , concatenate second dataset backwards. way closed polygon.

% example data t  = 1:100; x1 = sin(pi*t/10).*t x2 = 0.1*sin(pi*t/10).*t*2 + 25  plot(x1,t, x2, t,'linewidth',5); hold on area( [x1 x2(end:-1:1)], [t t(end:-1:1)],'facecolor','red'); hold off % or % area( [x1 fliplr(x2)], [t fliplr(t)],'facecolor','red'); hold off 

gives:

enter image description here


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -