From: Haneen Farah on
How do I convert a cell to double?

Thanks
From: us on
Haneen Farah <haneenfarah(a)gmail.com> wrote in message <560f0e65-c6dd-41d3-ac02-7edc77776d3c(a)d27g2000yqf.googlegroups.com>...
> How do I convert a cell to double?
> Thanks

one of the many solutions

c={magic(2)};
r=c{:};
isequal(r,magic(2))
% ans = 1

us
From: Oleg Komarov on
Haneen Farah <haneenfarah(a)gmail.com> wrote in message <560f0e65-c6dd-41d3-ac02-7edc77776d3c(a)d27g2000yqf.googlegroups.com>...
> How do I convert a cell to double?
>
> Thanks

cell2mat if each cell has a scalar double.

Oleg
From: Oleg Komarov on
Another way [c{:}]
or cat(2,c{:})

I'm wrong about the scalar, it converts also cells which contain matrixes or vectors as long as they comply with cat.

Oleg
From: Matt J on

Here's one way:

C={1,2,3,4};

Result=sum(C{:});