Undo "import"

15 ビュー (過去 30 日間)
metty
metty 2019 年 7 月 2 日
編集済み: Joe V 2022 年 5 月 25 日
There I use
import ETS3.*
Later when i try:
simplify(something,'steps',10)
There is an errormessage:
Error using RTBPose/simplify Too many input arguments.
So i guess the import-command is somehow overloading the simpify-command. Can I undo the import, command?
Something like:
clear ETS3.* %this does not help

回答 (2 件)

Kaustav Bhattacharya
Kaustav Bhattacharya 2019 年 7 月 2 日
For the sake of solving you can write a function with a different name with same parameters and inside that function, call the simplify function and return the result.
  1 件のコメント
metty
metty 2019 年 7 月 3 日
I tried:
function outputArg1 = mysimplify(input,steps)
outputArg1 = simplify(input,'steps',steps);
end
then in the main code:
mysimplify(something,10);
But I got still the same error-message.

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


Joe V
Joe V 2022 年 5 月 25 日
編集済み: Joe V 2022 年 5 月 25 日
You probably want this:
clear import
That will clear all imports (not just 'ETS3.*').
If you only want to clear the import of 'ETS3.*' and keep other imports, you'll have to do something clever, maybe like this:
I = setdiff(import, 'ETS3.*');
clear import;
cellfun(@import, I);
In case that code is hard to follow, here is a slightly longer, clearer version that does the same thing:
I = import;
clear import;
I = setdiff(I, 'ETS3.*'); % remove 'ETS3.*' from I
for i = 1:numel(I)
import(I{i});
end
(If this seems awkward, and you need to do this a lot, consider submitting a bug report/feature request to MathWorks Support.)
One other note: This only works from the command prompt. Within a function, you can't use clear import. But the imports are removed at the end of the function.

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by