Can you tell me what's wrong with this file?

댓글 수: 2

madhan ravi
madhan ravi 2020년 10월 28일
No files are attached.
Gilbert Bates
Gilbert Bates 2020년 10월 29일
편집: Walter Roberson 2020년 10월 30일
Unfortunatley the compressed/zip file is still too large to attach.
Anyways, if I suspect running out of memory issues then I found that I can break up the large file by way of 'datastore' so I was going to try that. But I'm stuck and confused by this type name value pair thing with the following error.
Specify the 'Type' name-value pair argument to indicate the type of datastore to create.
ds = datastore('E:\Rise_Times\7436.mat','mat','tall');
tt = tall(ds);
The following doesn't work, how to correct? I know the file location as indicated, but not sure what I need for 'type' it's a matlab file.
ds = datastore('E:\Rise_Times\1000 Hz_10 percent_110 A_start.mat','mat','tall');
tt = tall(ds); %<- Not sure if I need this?
Thank you!

댓글을 달려면 로그인하십시오.

답변 (1개)

drummer
drummer 2020년 10월 30일
편집: drummer 2020년 10월 30일

0 개 추천

"But I'm stuck and confused by this type name value pair thing with the following error.
Specify the 'Type' name-value pair argument to indicate the type of datastore to create."
ds = datastore('E:\Rise_Times\7436.mat','mat','tall');
The name-value pair argument is a feature of MATLAB so you can inform to the native functions what value you assigning to whatever argument name you want to modify.
In your ds, you should specify the name of the argument, as you correctly specified the values.
ds = datastore('yourPath/blah.mat', 'FileExtensions', '.mat', 'Type', 'tall')
When you type ds in the command window, you will see your variable ds with the attributes of FileExtensions and Type you assigned.
Cheers

댓글 수: 6

Gilbert Bates
Gilbert Bates 2020년 10월 30일
Hmmm, thank you for the reply, but matlab is fighting back every step of the way. :-(
I followed the example exaclty below, the only difference is that I've added the path that matlab is looking at to a working directory where I have files for testing, so I just have the name of the file...
ds = ('1000 Hz_90 percent_1500W_start.mat', 'FileExtensions', '.mat', 'Type', 'tall')
This is what happens...
>> ds = ('1000 Hz_90 percent_1500W_start.mat', 'FileExtensions', '.mat', 'Type', 'tall');
ds = ('1000 Hz_90 percent_1500W_start.mat', 'FileExtensions', '.mat', 'Type', 'tall');
Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
It points to the first comma???
The second thing I've tried, which should be valid, is to break up the commands with the following...
ds = ('1000 Hz_90 percent_1500W_start.mat');
t = tall(ds);
In this case ds literally becomes the name of the file and t is a 1x33 array of the words/letters in the file name.
What's wrong and thanks!
drummer
drummer 2020년 10월 30일
you forgot to mention the function
ds = datastore( ... )
If you want to read your .mat file, you should
ds = load('youFile.mat')
Gilbert Bates
Gilbert Bates 2020년 10월 30일
Doh!
Thanks, but now it doesn't like 'FileExtensions'
>> ds = datastore('1000 Hz_90 percent_1500W_start.mat', 'FileExtensions', '.mat', 'Type','tall');
Error using datastore (line 169)
'FileExtensions' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for TallDatastore.
drummer
drummer 2020년 10월 30일
I wonder .mat is not accepted for datastore. You can always check the documentation for datastore.
Also looking at how you want to load your .mat file in this doc as well for tallDatastore.
perhaps if you try
ds = datastore('yourFile.mat', 'Type', 'tall'); % already, without 'FileExtensions'
Gilbert Bates
Gilbert Bates 2020년 10월 30일
Thank you drummer!
I did try the variation you suggested, among many variations, with all resulting in some other error. But I think you are correct with datastore accepting .mat and following a few links, I think it is the filedatastore command that I need to use and that's where .mat is being mentioned. However, it looks like I need to write a custome read function as part of the commend. I'm looking through it now...
Walter Roberson
Walter Roberson 2020년 10월 30일
'fileextensions' might be from a release newer than you are using. I think it was added in R2019b.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

태그

질문:

2020년 10월 28일

댓글:

2020년 10월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by