> On Mon, Apr 12, 2010 at 11:11 AM, abigi <[hidden email]
> <
http://n4.nabble.com/user/SendEmail.jtp?type=node&node=1836865&i=0>>
> wrote:
>
> >
> > Dear Octave forum,
> >
> > I am quite a beginner in Octave. I am using Octave 3.0.5 on a
> x86_64 pc
> > linux. I have quite a few numeric data (measurement) which I would
> need to
> > save into a text file according to the following structure of:
> >
> > 1st column -> dates
> > 2nd : 130th colums -> numeric data
> >
> > I had more than a look to datestr, save, fprintf but I had troubles
> with
> >
> > - creating a matrix or something alike with that structure (1
> column of
> > date/character type data, other cols numeric data), so that I could
> save
> > straightly. I am doubting that is possible to have this kind of data...
> > something like a "dataframe" in R
> >
> > - to generate a sequence of dates I have used strvcat + datestr,
> resulting
> > in a character vector: is that a good way to solve this issue?
> >
>
> Sure, why not?
>
> > - I have tried with merging everything in a string matrix, but then
> it was
> > getting even messier...
> >
> > Any suggestion is welcome, thanks,
> >
> > Alessandro
> >
>
> You can handle tasks like this and much more with fprintf.
> Do something like this (not tested):
>
> dates = # NxK character matrix of dates
> numbers = # Nx129 numeric matrix of your numeric data
>
> ## prepare format of a single row
> format = ["%s", repmat(" %f", 1, 129), "\n"];
>
> ## prepare data sequentially, as it needs to be printed
> seq_data(1, :) = cellstr (dates);
> seq_data(2,:) = num2cell (numbers, 2);
>
> fprintf (fid, format, seq_data{:});
>
> hth
>
>
> --
> RNDr. Jaroslav Hajek, PhD
> computing expert & GNU Octave developer
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
>
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> <
http://n4.nabble.com/user/SendEmail.jtp?type=node&node=1836865&i=1>
>
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave>
>
> ------------------------------------------------------------------------
> View message @
>
http://n4.nabble.com/save-both-dates-and-numeric-data-tp1836839p1836865.html
>
> To unsubscribe from save both dates and numeric data, click here
> <
<Link Removed>>.
>
>