Hi , explain MCODE & PERSISTENT rules for the program which uses FOR LOOP?

1 回表示 (過去 30 日間)
run moves
run moves 2014 年 4 月 17 日
編集済み: run moves 2014 年 4 月 22 日
Hi every one, I implemented matlab code for adaptive recursive least square filter and got the results for .m file . As I have to use my code in mcode it shows errors for ‘/ ‘(division) symbol in for loop without division my algorithm cant implement our algorithm. I referred about mcode rules but it wasn`t clearly explained about persistent, division symbol. If anyone from matlab support domain justify our problem for implementation we can clearly understood what is real problem. Thank you in advance.

採用された回答

Walter Roberson
Walter Roberson 2014 年 4 月 17 日
Do you need "/", or do you need "./" instead? "/" is not division, it is matrix division, which can be a form of fitting (depending on the rank of the matrices involved.) It would be a rather expensive operation to implement in HDL, especially if you needed full floating point.
If you need division, the "./" operator, then the cost of implementing that is going to depend upon the data types involved. You should be considering using the Fixed Point Toolbox.
  1 件のコメント
run moves
run moves 2014 年 4 月 22 日
編集済み: run moves 2014 年 4 月 22 日
First of all thank you for your reply sir. As im working with MCODE block in simulink. How come MCODE code does not allow me to do simple division like a/b in which a,b are 8,4. So how come MCODE block is useful for implementing programs which involves mathematical operations. Please do reply sir .discussing with topic helps me to know better . Thank you in advance.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by