Dear James,
I wanted to import the muse csv data to the Matlab, and followed the steps you provided on the website. But when running the syntax, an error (Error: File: mmImport.m Line: 1 Column: 46) and invalid syntax were shown on the command window and the editor. respectively. Could you please help me solve this problem? Thank you.
Star
Import Data to Matlab
Import Data to Matlab
- Attachments
-
- error.png (211.32 KiB) Viewed 17601 times
Re: Import Data to Matlab
Don't edit the script, just run the command.
Change the first line back to
Then run the command in the command line to import.
Change the first line back to
Code: Select all
function [museData, museElements] = mmImport(fileName)
Re: Import Data to Matlab
Dear James,
as you can see, I change the first line back to [museData, museElements] = mmImport(fileName), and run the command. But there was also an error (Error in mmImport (line 10)) shown on the screen. Please kindly help me that! Many thanks.
Star
as you can see, I change the first line back to [museData, museElements] = mmImport(fileName), and run the command. But there was also an error (Error in mmImport (line 10)) shown on the screen. Please kindly help me that! Many thanks.
Star
Re: Import Data to Matlab
Dear James,
as you can see, I change the first line back to [museData, museElements] = mmImport(fileName), and run the command. But there was also an error (Error in mmImport (line 10)) shown on the screen. Please kindly help me that! Many thanks.
Star
as you can see, I change the first line back to [museData, museElements] = mmImport(fileName), and run the command. But there was also an error (Error in mmImport (line 10)) shown on the screen. Please kindly help me that! Many thanks.
Star
- Attachments
-
- error2.png (209.84 KiB) Viewed 17593 times
Re: Import Data to Matlab
You need to update MatLab, sorry.
According to the MatLab documentation, detectimportoptions requires at least version R2016b:
https://www.mathworks.com/help/matlab/r ... tions.html
According to the MatLab documentation, detectimportoptions requires at least version R2016b:
https://www.mathworks.com/help/matlab/r ... tions.html
Re: Import Data to Matlab
I have the same error with MATLAB R2018a
[museData, museElement] = mmImport('museMonitor_2019-07-03--09-05-48.csv')
Undefined function or variable 'delimitedTextImportOptions'.
Error in mmImport (line 10)
opts = delimitedTextImportOptions('VariableNames',varNames,...
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.4.0.813654 (R2018a)
MATLAB License Number: 40426278
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 17763)
Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
[museData, museElement] = mmImport('museMonitor_2019-07-03--09-05-48.csv')
Undefined function or variable 'delimitedTextImportOptions'.
Error in mmImport (line 10)
opts = delimitedTextImportOptions('VariableNames',varNames,...
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.4.0.813654 (R2018a)
MATLAB License Number: 40426278
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 17763)
Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Re: Import Data to Matlab
Sorry, I'm not sure why you're getting that error.
According to the docs, the delimitedTextImportOptions function was introduced in R2016b, so it should work fine with your version.
I checked through the release notes and there was a change in R2018a, which notes "Use property name DataLines instead of DataLine."
https://www.mathworks.com/help/matlab/r ... ortOptions
As you're using R2018a, so you shouldn't need to do anything. Maybe try changing it from DataLines to DataLine (line 14) and see if that fixes it?
The best thing to do would be to upgrade though. For reference, I tested the script with R2019a.
According to the docs, the delimitedTextImportOptions function was introduced in R2016b, so it should work fine with your version.
I checked through the release notes and there was a change in R2018a, which notes "Use property name DataLines instead of DataLine."
https://www.mathworks.com/help/matlab/r ... ortOptions
As you're using R2018a, so you shouldn't need to do anything. Maybe try changing it from DataLines to DataLine (line 14) and see if that fixes it?
The best thing to do would be to upgrade though. For reference, I tested the script with R2019a.
Re: Import Data to Matlab
Thank you. Just updated to 2019a. I am sure it will work. Cheers