MATLAB-xy曲线下的条纹区域(弯矩分布) [英] MATLAB - striped area under the xy curve (bending moment distribution)
本文介绍了MATLAB-xy曲线下的条纹区域(弯矩分布)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要实现的是一个经典的弯矩分布图,该图可能看起来像这样:
what I want to achieve is a classical bending moment distribution plot that may look something like that:
我尝试使用面积图,xy图和条形图,最后一个图是最接近我需要的图-但这仍然不是我可以接受的.我可以使用任意形式的数据.
I tried to use area, xy, and bar plot and the last one is the closest to what I need - but it's still not what I can accept. I can use data in arbitrary form.
推荐答案
而 Daniel的答案更为笼统,可以用于倾斜的条纹,这是使用stem
而不使用标记和基线的简单解决方案:
While Daniel's answer is more general, and can be used for slanted stripes, here's a simpler solution using stem
without markers and baseline:
x1 = -3;
x2 = 2;
upfun = @(x) -1/10*(x-x1).*(x-x2);
downfun = @(x) 1/5*(x-x1).*(x-x2);
x_dense = linspace(x1,x2,100);
x_sparse = linspace(x1,x2,20);
%// plot outline
plot(x_dense,upfun(x_dense),'b-',x_dense,downfun(x_dense),'b-');
hold on;
%// plot stripes
stem(x_sparse,upfun(x_sparse),'b','marker','none','showbaseline','off');
stem(x_sparse,downfun(x_sparse),'b','marker','none','showbaseline','off');
结果:
这篇关于MATLAB-xy曲线下的条纹区域(弯矩分布)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文