Unrecognized function or variable 'e'
Show older comments
a = [1 2 3; 4 5 6; 7 8 9]
b = [7 5 6]
c = [19 23; 31 29; 17 13]
d = [e(1:2,:); f; e(3,:)]; % matrix f is inserted between the third and second row of e creating matrix d
e = [a(1,:);b(1,3);c(:,2).'] % matrix e consists of the first row of a, the second row of b and the transpose of the second column of c
f = c(:,1).' % matrix f is the transpose of the first column of matrix c
m = diag(a(:)) %
m = [diag(a); diag(b)] %
I was wondering why the matrix e wasn't recognised as it was working before.
When I tried it with 3 zeros [a(1,:); 0 0 0;c(:,2).'] . Why won't it accept b as the middle row?
1 Comment
Maybe this is some help? I don't know what you're doing with the second row of b, but f and e need to be defined before you can use them.
a = [1 2 3; 4 5 6; 7 8 9]
b = [7 5 6]
c = [19 23; 31 29; 17 13]
% "second row of b" ... but b only has one row?
% e = [a(1,:);b(2,:);c(:,2).'] % matrix e consists of the first row of a, the second row of b and the transpose of the second column of c
e = [a(1,:); b; c(:,2).'] % maybe you meant "the second row is b"?
f = c(:,1).' % matrix f is the transpose of the first column of matrix c
% f and e need to exist first
d = [e(1:2,:); f; e(3,:)] % matrix f is inserted between the third and second row of e creating matrix d
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!