Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isempty(sweepVar) is never true (it is scalar string), thus no warning is issued #2

Open
benjaminkraus opened this issue Dec 18, 2023 · 1 comment

Comments

@benjaminkraus
Copy link

If I put my cursor on line 4 of this file:

a = 1;
x = linspace(0,4*pi,1000);
y = a.*sin(x);
plot(x,y);

The function ConnectButtonPushed calls splitCode which outputs a scalar string object called sweepVar. Because it is always a scalar string object, isempty(sweepVar) is never true, so the code assumes it found valid line of code and does not issue the expected warning.

@gulley
Copy link
Owner

gulley commented Dec 19, 2023

Thanks for opening this issue and doing some detective work besides. Mixing char arrays and strings is bad practice. Fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants