% vectors x=[8 2 2] and y=[7 9 3], compute arrays:
% 1. a_ij=x_i y_j
% 2. b_ij=x_i/y_j
% 3. c_ij=x_i y_j then add up the elements of c. (dot product)
% 4. d_ij=x_i/(2+x_i+y_j)
% 1.
clcclose allx = [8 2 2];y = [7 9 3];a(1i,1i) = x(1i,:).*y(:,1i);disp(a)Error in Ass1Q9 (line 16)a(1i,1i) = x(1i,:).*y(:,1i);
MATLAB: Index in position 1 is invalid. Array indices must be positive integers or logical values.
3x1 * 3x1complex numbersi jmatrices
Related Question
- Subscript indices must either be real positive integers or logicals.
- Error “Subscript indices must either be real positive integers or logicals.” At random index
- How do i view the velocity profile
- Closest value in an array, and how to correctly look it up afterwards
- How to add integer cut to MILP constraints to find alternative optimal solutions
Best Answer