- #1
Zayri7
- 1
- 0
I've been stuck for weeks on a code that I have been generating for image processing. And made an example of what I need. I have this code: (BTW I am new to this MATLAB world)
A = [2, 5, 6; 3,6,7];
B = [5, 3, 1; 7,3,2];
for i=1:3
v = genvarname('C', who);
eval([v '= A-B'])
end
The part above ^^^^ gives me this:
C =
-3 2 5
-4 3 5
C1 =
-3 2 5
-4 3 5
C2 =
-3 2 5
-4 3 5
This is the part I am having problem explaining.
I want to do something like this:
for n=1:3
F{n} = C{n}(2,1) + B(2,1)
end
But it tells me:
Cell contents reference from a non-cell array object.
I really don't know what to do. Can someone help me?
A = [2, 5, 6; 3,6,7];
B = [5, 3, 1; 7,3,2];
for i=1:3
v = genvarname('C', who);
eval([v '= A-B'])
end
The part above ^^^^ gives me this:
C =
-3 2 5
-4 3 5
C1 =
-3 2 5
-4 3 5
C2 =
-3 2 5
-4 3 5
This is the part I am having problem explaining.
I want to do something like this:
for n=1:3
F{n} = C{n}(2,1) + B(2,1)
end
But it tells me:
Cell contents reference from a non-cell array object.
I really don't know what to do. Can someone help me?