% Values of constants
l = 89;h = 49;D = 55;beta1 = 11.5;alpha = 33;% Compute A, B, C, E
A = l*sind(Beta1); B = l*cosd(Beta1);C = (h+0.5*D)*sind(beta1) - 0.5*D*tand(beta1);E = (h+0.5*D)*cosd(beta1) - 0.5*D;sindalpha = sind(beta1);cosddalpha = cosd(beta1);% output
output = A*sindalpha*cosdalpha + B*sindalpha^2 - C*cosdalpha - E*sindalpha;disp ('Part a)')fprintf('%f\n',output);
MATLAB: I get this error message for this code: Array indices must be positive integers or logical values.
MATLAB
Related Question
- Array indices must be positive integers or logical values.
- How to plot two equation consequetively
- How to fix this error? Subscript indices must either be real positive integers or logicals.
- Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Best Answer