绘制函数以及一系列不同的常数值参数 [英] Plotting a function together with a range of different constant value parameters

查看:73
本文介绍了绘制函数以及一系列不同的常数值参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mathematica可以轻松地在常数的不同值范围内绘制具有常数参数的函数.

Mathematica easily plots a function with constant value parameters over a range of different values for the constant(s).

使用MATLAB,这可能吗?

With MATLAB, is this possible?

例如:MATLAB是否允许我绘制a的不同常数值的f(x)=x*e^a?

For instance: would MATLAB allow me to plot f(x)=x*e^a of different constant values of a?

推荐答案

取决于您如何轻松定义:

Depends how you define easily:

>> alpha = [0.1 0.2 0.5 1];
>> x = 0:0.01:2;
>> plot(x,exp(x(:)*alpha))
>> grid on
>> legend(arrayfun(@(a)sprintf('alpha = %.2f',a),alpha,'uni',false))

这篇关于绘制函数以及一系列不同的常数值参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆