the input N change in formula input

hi can any one tell me i have a formula D = −(2πc/λ^2) N where the c and λ are constant.but i want to make a program using matlab in which i give the any value of N its show the output. can any one tell m what i do... thnx

 采纳的回答

Lamda=1;
c=2;
D = @(N) -(2*pi*c/Lamda^2)*N
D(5) % for N=5

3 个评论

D =
@(N)-(2*pi*c/Lamda^2)*N
its show only this answer..how i put the value of n
You can use
N=input('enter N')
Lamda=1;
c=2;
D = -(2*pi*c/Lamda^2)*N;
display(D)
You should learn Matlab basics

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by