Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
I have mmss dates and I need to get mm and ss separately

Subject: I have mmss dates and I need to get mm and ss separately

From: Camille Couzi

Date: 3 Feb, 2011 14:50:05

Message: 1 of 3

Hi matlabers!

I need your help for a little problem I have with some dates...

I have a vector which contains numbers like that:
a=5620

That means that there are 56min ans 20 sec.

How can I get the min and sec separately?
ie I need to get:
minutes=56
seconds=20

Is that with sscanf? I don't know how to use it...
any suggestion will be very, very usefulll.

Thanks in advance!

Subject: I have mmss dates and I need to get mm and ss separately

From: Donn Shull

Date: 3 Feb, 2011 15:53:03

Message: 2 of 3

"Camille Couzi" <camillecouzi@yahoo.fr> wrote in message <iiefat$t69$1@fred.mathworks.com>...
> Hi matlabers!
>
> I need your help for a little problem I have with some dates...
>
> I have a vector which contains numbers like that:
> a=5620
>
> That means that there are 56min ans 20 sec.
>
> How can I get the min and sec separately?
> ie I need to get:
> minutes=56
> seconds=20
>
> Is that with sscanf? I don't know how to use it...
> any suggestion will be very, very usefulll.
>
> Thanks in advance!

minutes = floor(a/100)
seconds = a - minutes*100

Subject: I have mmss dates and I need to get mm and ss separately

From: Camille Couzi

Date: 3 Feb, 2011 20:23:04

Message: 3 of 3

Thanks a lot!!!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us