フィルターのクリア

for loop in equation

2 ビュー (過去 30 日間)
Kutru biladi
Kutru biladi 2015 年 7 月 22 日
回答済み: Star Strider 2015 年 7 月 22 日
Yo Volks, i am new in programming. i want to apply for loop in the equation 'phi_acc' which goes from '1 to nsamples' and after that want to put it in the phi equation.
phi_sync = rand(1,nsamples);
phi_acc = rand(1,nsamples);
phi = phi_sync(nsamples) + Phi_acc(nsamples);

採用された回答

Star Strider
Star Strider 2015 年 7 月 22 日
The code you posted will take the last values of ‘phi_sync’ and ‘phi_acc’ to calculate ‘phi’. (Also, MATLAB is case-sensitive, so ‘Phi_acc’ is a different variable from ‘phi_acc’, and will throw an error if you haven’t defined it.)
If you want to add the two vectors of the same size, just use:
phi = phi_sync + phi_acc;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by