Function of many input arguments returns only one value

1 回表示 (過去 30 日間)
Beaya
Beaya 2013 年 10 月 27 日
編集済み: Azzi Abdelmalek 2013 年 10 月 27 日
I have this function:
n = [0 :1: 40], x = 1.0,
v = ((sin(x + 2.^-n) + cos(3*x + 2.^-n)) - (sin(x) + cos(3*x)))/(2.^-n)
It only displays the result for the first value of n and I would like to get the results for all n from 0 to 40. How do I do this? I tried to modify this in many ways but nothing seems to work...

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 27 日
編集済み: Azzi Abdelmalek 2013 年 10 月 27 日
You missed ./
n = [0 :1: 40], x = 1.0,
v = sin(x + 2.^-n) + cos(3*x + 2.^-n) -(sin(x) + cos(3*x))./(2.^-n)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by