For loop syntax in example gives me errors?

8 ビュー (過去 30 日間)
Adam
Adam 2014 年 2 月 12 日
編集済み: per isakson 2014 年 2 月 12 日
Very new to matlab, have done c-programming before
Why does a for loop work for me when i use a matrix syntax
if i=1:10
i
end
1 2 3...
but when I use the syntax in the examples here: http://www.mathworks.com/help/symbolic/mupad_ref/for.html
i.e. for i from 1 to 20 do ...
I get an error message and in the editor it says 'from' is a parse statement Why can't I paste the exact examples on the matlab page and have it work? Are those examples just conceptual or am I not understanding how matlab works its very frustrating because its something so simple...

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 12 日
編集済み: Azzi Abdelmalek 2014 年 2 月 12 日
This example uses Mupad, in Matlab windows command lunch Mupad by
mupad
You can read in the link you posted
Use only in the MuPAD Notebook Interface. This functionality does not run in MATLAB

per isakson
per isakson 2014 年 2 月 12 日
編集済み: per isakson 2014 年 2 月 12 日
The link is to the help of the symbolic toolbox, which I know little about. However, its syntax of for-loops differ from that in plain Matlab. See http://www.mathworks.se/help/matlab/ref/for.html

カテゴリ

Help Center および File ExchangeGet Started with MuPAD についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by