フィルターのクリア

How do I input/use functions from stats?

3 ビュー (過去 30 日間)
Michael Haas
Michael Haas 2016 年 12 月 6 日
コメント済み: Jan 2016 年 12 月 6 日
For example: if I input "stats::variance(2, 3, 5)" I get the following error Error: Unexpected MATLAB operator. % with an arrow to the operator "::"
It's an example from the matlab documentation: https://de.mathworks.com/help/symbolic/mupad_ref/stats-variance.html Example 1
If I leave "stats::" I get the message "Undefined function or variable 'variance'."
Thanks everyone who tries to help me :)

回答 (2 件)

Steven Lord
Steven Lord 2016 年 12 月 6 日
Any command that includes "::" in the name is a MuPAD function intended for use in a MuPAD Notebook. Those functions cannot be used in a MATLAB function or in the MATLAB Command Window without using the evalin method or the feval method of the symengine object to call them.

Jan
Jan 2016 年 12 月 6 日
編集済み: Jan 2016 年 12 月 6 日
"::" is no Matlab operator, so I cannot guess your intention to use it.
In fact, Matlab does not have a command called "variance". You can find the command for calculateing variances in the documentation:
docsearch variance
The var command does not accept (2,3,5) as input. Perhaps you want:
var([2,3,5])
Did you work with Matlab before? If not, reading the "Getting Started" chapters of the documentation is recommended and Matlab's Onramp helps to learn the basics also.
  2 件のコメント
Michael Haas
Michael Haas 2016 年 12 月 6 日
Thank you very much. It's a copy from an example in the matlab documentation: https://de.mathworks.com/help/symbolic/mupad_ref/stats-variance.html Example 1
Jan
Jan 2016 年 12 月 6 日
Ah, this explains the non-Matlab syntax. Sorry, I do not have the MuPad toolbox.

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

カテゴリ

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