ReflRayData = zeros((length(xrange)-1)*(length(yrange)-1),length(ThetaIncident),(length(xrange)-1)*(length(yrange)-1)) % Matrix containing Reflected Ray Data
OvenGlassXrange = %Range of X coordinates for Oven Glass ThetaIncident = ' % Incident Angle of Ray (measured relative to normal direction with clockwise postive) Yrange = ' % Coordinates to try for Panel Geometry (in) Xrange = ' % Coordinates to try for Panel Geometry (in) If ReflRayData(Count2,ThetaPlot(m) - ThetaIncident(1) + 1,Count1) = 1įull Code: %% Calculating Angles of Reflection Title = sprintf('Angle(%d)',ThetaPlot(m)) įor i = 1:length(xrange)-1 % X Coordinate of Start Nodeįor j = 1:length(yrange)-1 % Y Coordinate of Start Nodeįor k = 2:length(xrange) % X Coordinate of End Nodeįor l = 2:length(yrange) % Y Coordinate of End Node Thanks ThetaPlot = % Put incident angle as input If anyone can find the error of my ways it would be greatly appreciated.
I don't understand since in both steps of the debugger NewColor = 0.1, and the code is written so the color of the lines =. To the contrary and my disbelief an orange line shows up (in addition to the blue line). Therefore, when I run the next step a blue line should show up on the current plot.
I check the editor to find that NewColor = 0.1. When I do this I am still within the "i for loop", so NewColor has not changed. Next, I use the "run to cursor" command to step to the next time the plot command is activated. I check the value of NewColor and find NewColor = 0.1. I run the next step and a plot is created with a blue line. Suppose I am in debug mode and I have stopped at the plot command. However, the following problem has been occurring: I want each plot to have lines with different colors (from other plots), so I created a variable = "NewColor" to increment and change the line colors. In the code, a new plot is created (with its own figure) when the "if loop" condition is satisfied. I have written a code where I want to change the color of lines in a plot that is embedded in several for loops (the code is shown below). I have a question about changing the color of lines in a plot in MATLAB.