create multiple mat files for storing data

1 次查看(过去 30 天)
Hello Everyone,
I am reading in data from a device and want to store it in a mat file. Currently I am directly storing my readings in a mat file using save command. I want to store these readings in multiple mat files for operational efficiency.
So for example I have 100 readings I want to create 10 mat files where each mat file contains 10 readings.
Thanks
  3 个评论
Jan
Jan 2013-7-11
This is to vague to create an answer. We cannot know how your "10 readings" are represented in your program. So please add more details by editing the question.
Ricky
Ricky 2013-7-11
Sorry for the vague question actually my problem is I am saving cell arrays in my mat file. So my code reads the raw data from binary file saves that in a cell array and stores that cell array in mat file. I have predefined the size of cell array in which raw data is being parsed. While saving this data in mat file my MATLAB becomes very slow and I run into out of memory. So my idea was to create multiple mat files so that I can solve memory problem as I will be using less virutal memory. I am not sure if this the correct approach.

请先登录,再进行评论。

采纳的回答

Titus Edelhofer
Titus Edelhofer 2013-7-11
Hi Ricky,
instead of creating multiple .mat files you might try to create one .mat file and access variables in there in parts (using the matfile object).
doc matfile
Titus
  1 个评论
Ricky
Ricky 2013-7-11
Hi Titus,
Actually the problem was that I was parsing my one row of input data and storing it. Then parsing the second row and storing it. This was causing this memory problems in MATLAB.
I have another question regarding out of memory error but I will ask in other thread.
Thanks for your time.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by