Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Matlab matrix
Replies: 2   Last Post: Feb 1, 2013 5:53 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 8,982
Registered: 6/7/07
Re: Matlab matrix
Posted: Feb 1, 2013 5:53 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/1/2013 3:46 PM, James Tursa wrote:
> "M" wrote in message <kehbrk$3pp$1@newscl01ah.mathworks.com>...
>> How I can put time value like 10:23:34 in a matrix cell. Like below:
>> a(1,2)= 10:23:34

> One approach is to use a cell array and have the entry be a string. E.g.,
> a = cell(1,2);
> a{1,2} = '10:23:34';

And another is to use the fractional portion of a datenum representation--

>> a{1,2}=datenum('10:23:34',upper('hh:mm:ss'))-
a =
[] [0.4330]
>> datestr(a{1,2},'HH:MM:SS')
ans =


Date Subject Author
Read Re: Matlab matrix
James Tursa
Read Re: Matlab matrix

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.