Info

この質問は閉じられています。 編集または回答するには再度開いてください。

execution order in debug mode

1 回表示 (過去 30 日間)
Okki Hiwi
Okki Hiwi 2019 年 4 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello everyone,
My Problem:
I cannot find the array "minus" in the Workspace.
What I did:
I am running a Matlab-fcn block inside a Simulink model. The code is from that fcn-block. The fcn has 13 inputs that I saved in an double array called "inputs". I am now in debugger mode and the all commands work in the command window, but not in the code.
Code:
%inputs is a vektor of all my input variables
minus = inputs(inputs<0); %THIS DOESNT WORK in code
minus_index = find(inputs<0); % this works in code
plus = find(inputs >= 0); % also doesnt work
nMinus = length(minus); %this works correctly in code although I cant find minus in the workspace (I can find nMinus and inputs in the workspace.)
Can anyone help me with that or verify to get the same results? It seems to be quiet basic syntax so I really dont know why it doesnt work. I suppose the debugger mode isnt working like it should.
Thank you in advance :)
  5 件のコメント
Stephen23
Stephen23 2019 年 4 月 27 日
編集済み: Stephen23 2019 年 4 月 27 日
It is a VERY BAD IDEA to call your arrays minus or plus because that will shadow the very important inbuilt functions minus and plus:
I STRONGLY recommend that you call your arrays something else. Using those names will produce unexpected results and might not behave the same during debug mode.
Okki Hiwi
Okki Hiwi 2019 年 4 月 27 日
編集済み: Okki Hiwi 2019 年 4 月 27 日
Thank you for the answer, but I also renamed them to something different. It didnt work either. I dont think the name "Hasi" is also a matlab function.

回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by