Can I save a row of data that has numeric and non-numeric elements?
2 views (last 30 days)
Show older comments
I have several data files (samples) that I need to process individually. The result is numeric values in a row. What I would like is to have the file name at the beginning of each row and be able to save the file so that I can append it after I process each sample.
Is there anyway to create a variable that can be saved to a file (that can be appended) that contains both numeric and non-numeric elements?
This is what I'm trying to end up with:
Sample_1 v1 v2 v3
Sample_2 v1 v2 v3
Sample_3 v1 v2 v3
thanks,
Michael
0 Comments
Answers (2)
the cyclist
on 11 May 2013
Cell arrays are designed to hold mixed-type data.
S = {'Sample_1',1, 2, 3}
See this documentation for lots more info:
0 Comments
Michael
on 11 May 2013
2 Comments
Image Analyst
on 11 May 2013
I don't think he can delete his "answer" (which should have been a comment) if someone has responded to it.
the cyclist
on 12 May 2013
Michael, I'm pretty sure you should be able to accomplish what you want. Here is what I suggest. Your original question really did not give enough detail on what you wanted to do. (For example, you just said "save to a file", but what you really wanted was to write Excel.)
In rereading your question and then the other detail you added later, it is frankly still not clear what you are trying to do. I suggest you abandon this question and start a new one, really trying to focus on a very clear and specific outline of what you want. Remember, we don't know anything other than what you tell us.
See Also
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!