To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
m = .02 p = .4 t = .12 x = [0 : .01 : .75] for i = 1 : length(x) z(1, i) = (.5 * nacathick(t, x(i)) + nacacamber(m, p, x(i))) z(2, i) = (-.5 * nacathick(t, x(i)) + nacacamber(m, p, x(i))) end
Beside other not useful things, "clear all" removes all breakpoint in the code. Therefore it impedes debugging. But debugging is the best way to solve problems!
So I suggest to omit the "clear all" (and most likely neither clc nor close all are useful also), set a breakpoint in the first and step through the code line by line to inspect, what's going on.
Btw., who suggests such cruel clearing headers like "clc; close all; clear all"? It appears such frequently in the code of beginners that I assume they should be kept away from the debugger for any evil purposes. "clc" hides even valuable warning messages in the command window - how strange.
It would be very nice and useful, if the knowledge, that eval and numbered names of variables like "A1", "A2", ... should be avoided, would be such wide-spread as the "clear all" killer.