Transposing cell arrays is behaving like cellfun
1 view (last 30 days)
Show older comments
I was having some strange errors, and eventually figured out that this was going on. Take a simple example.
a = cell(1, 2)
a{1} = 'wx'
a{2} = 'yz'
Now, let's transpose.
EDU>> aT = a'
aT =
[2x1 char] [2x1 char]
EDU>> size(aT)
ans =
1 2
EDU>> size(a)
ans =
1 2
EDU>> aT{1}
ans =
w
x
Isn't this weird? Did I change some setting or something that is messing this up?
0 Comments
Accepted Answer
the cyclist
on 19 Nov 2014
That's not what I get. I get that aT is a 2x1 cell array, as you expected.
Could you have somehow redefined the ctranspose function, which is what the "apostrophe" calls? What you do you get when you type
which -all ctranspose
?
More Answers (0)
See Also
Categories
Find more on Structures 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!