From: yigit ozsahin on
The subject of this post did not state what I want to do in matlab. I can give an example that what I am looking for.

Ex
x=12345678

I want to group by 2
x=[12 34 56 78]
group by 4
x=[1234 5678]
group by 1
x=[1 2 3 4 5 6 7 8 9]

If you would give me an solution like an example I will be glad. Thanks for helping.
From: the cyclist on
"yigit ozsahin" <yigitozsahin(a)gmail.com> wrote in message <hruk6h$fda$1(a)fred.mathworks.com>...
> The subject of this post did not state what I want to do in matlab. I can give an example that what I am looking for.
>
> Ex
> x=12345678
>
> I want to group by 2
> x=[12 34 56 78]
> group by 4
> x=[1234 5678]
> group by 1
> x=[1 2 3 4 5 6 7 8 9]
>
> If you would give me an solution like an example I will be glad. Thanks for helping.

Sounds like homework. Commands that might be useful to you are "num2str" and "str2num", if x was given to you as a number.

Alternatively, you could divide your number by appropriate powers of 10, then use the "floor" function creatively.

If this is homework, and you have no idea how to get started, I recommend you go to your professor, tell him/her you have no idea how to get started, and ask for advice.

the cyclist
From: yigit ozsahin on
thank you for helping dividing to 10 and using command floor helped to solve my problem.
just now wondering how can I found a lenght of a number.
From: dpb on
yigit ozsahin wrote:
> thank you for helping dividing to 10 and using command floor helped to
> solve my problem.
> just now wondering how can I found a lenght of a number.

What is the definition of "length" for a number? You mean the ascii
(character) representation?

--
From: yigit ozsahin on
I solved that problem also thank you.