I am writing a code for a class project. It requires me to do same calculations for two different cases based on user input. I was going to code it in a way that the program would ask user which case to follow. However, I found out that because of various parameters related to each other, this will be extremely difficult. However, I thought of another way to do this but I don't know if I could do it in Matlab. So the way I want to code is, I would ask the user to choose one of the two cases, and based on his input, I would comment or uncomment OR read or skip a bunch of lines or line numbers. Is this possible to do in a running Matlab script? I know how to comment/uncomment a line in a Matlab script that's not running, but I was wondering if there is a syntax to skip reading certain lines in a running Matlab script.
MATLAB: Syntax to comment/uncomment line(s) of code in a Matlab script
skip linesuncomment
Best Answer