Info

This question is closed. Reopen it to edit or answer.

execution order in debug mode

1 view (last 30 days)
Okki Hiwi
Okki Hiwi on 27 Apr 2019
Closed: MATLAB Answer Bot on 20 Aug 2021
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 Comments
Stephen23
Stephen23 on 27 Apr 2019
Edited: Stephen23 on 27 Apr 2019
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 on 27 Apr 2019
Edited: Okki Hiwi on 27 Apr 2019
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.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!