Why is 'quaternion' not a valid class name in zeros() function?

10 ビュー (過去 30 日間)
SY
SY 2021 年 9 月 20 日
移動済み: Remo Pillat 2023 年 5 月 16 日
I have the Sensor Fusion and Tracking Toolbox which comes with a zeros() function for creating a quaternion array with all parts set to zero.
The documentation for the function lists the following as an example use of this function:
quatZeros = zeros('quaternion')
But when I enter this exact code, I get the following error:
>> quatZeros = zeros('quaternion')
Error using zeros
CLASSNAME input must be a valid numeric or logical class name.
Why do I not seem to be able to use this function as detailed in the documentation? Am I missing a toolbox? I've reinstalled the toolbox along with my other toolboxes that might be relevant, such as the Aerospace Toolbox and the Aerospace Blockset with no resolution.
  3 件のコメント
SY
SY 2021 年 9 月 20 日
編集済み: SY 2021 年 9 月 20 日
Apologies, it was not my intent to include a hyperlink in my original question.
The link provided you provided works fine for me. The toolbox is installed for me. I've reinstalled it and I can run the quaternion() function without issue.
But I still cannot run the code in my original quesiton.
Steven Lord
Steven Lord 2021 年 9 月 20 日
Can you confirm that you are using release R2020b as this question is tagged?
Have you created any quaternion objects before trying to call the zeros function with 'quaternion' as input? If not, what happens if you do create a quaternion using its constructor and then call zeros?

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

回答 (1 件)

SY
SY 2021 年 9 月 20 日
移動済み: Remo Pillat 2023 年 5 月 16 日
I ended up requesting Technical Support because I suspected this was an installation issue.
The following instructions resolved my issue:
In order to refresh the file system, please save a backup of your 'pathdef.m' file, which can be located by using the command:
>> which -all pathdef
Before proceeding, ensure that you make a safe copy of the file by copying it to a folder outside of your MATLAB path.
After taking the backup, please execute the following commands in the MATLAB Command Window to restore the default MATLAB search path and rehash the toolbox cache:
>> restoredefaultpath
>> rehash toolboxcache
>> sl_refresh_customizations
After this step, please run the provided code:
>> quatZeros = zeros('quaternion')
If the issue is resolved, then you may want to save the new MATLAB search path by executing the following command:
>> savepath

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by