Page 1 of 3

Octave support?

Posted: Wed Jun 17, 2020 11:06 pm
by stargazer
Hi I saw Mind Monitor provides Matlab support. I wonder if there is also Octave support. It seems Octave does not have the "readtable" function, so this requires a rewrite. If needed I can write one but first I'd like to check if it is already available. Thanks.

Re: Octave support?

Posted: Thu Jun 18, 2020 12:33 am
by James
Try this
mmOctaveScripts.zip
mmOctaveScript
(1.13 KiB) Downloaded 289 times
and let me know if it works ok.

Re: Octave support?

Posted: Fri Jun 19, 2020 12:42 am
by stargazer
Thanks, James. For some reason it generates an empty figure without data on my Octave and Ubuntu. I will take a look later and get back to you.

Re: Octave support?

Posted: Fri Jun 19, 2020 10:52 am
by James
Email me your CSV file and I'll test it here. I've not used Octave before, so I probably made an error.
I'm testing using Octave 5.2.0 on Windows 10 x64

Re: Octave support?

Posted: Fri Jun 19, 2020 6:14 pm
by stargazer
Thanks. Just sent an email to Support@Mind-Monitor.com. Please check.

Re: Octave support?

Posted: Fri Jun 19, 2020 6:49 pm
by James
Fixed :-)
Your data file has two extra columns with the two secret algorithms in ;-)

This version will autodetect if you have the algorithms and work with both versions.
mmOctaveScripts.zip
(1.24 KiB) Downloaded 294 times

Re: Octave support?

Posted: Sat Jun 20, 2020 6:07 pm
by stargazer
Thank you so much again, James. Now the temp files can capture all data. Unfortunately the textscan function reads in only part of the data and then only 2 straight lines are plotted, on Windows 10 and Ubuntu. Not sure if you saw the same thing.

Anyway I tried the Matlab code and it worked perfectly with Matlab 2019. With Matlab 2018 the hex color codes do not work; maybe we can check the Matlab version and apply different 'Color' options.

Re: Octave support?

Posted: Sat Jun 20, 2020 8:35 pm
by James
If I import your CSV with

Code: Select all

[museData, museElements] = mmOctImport('_2020-06-15--13-43-56_6616100285349042216.csv');
then I get this graph with all five waves:
octave_Chart.png
octave_Chart.png (213.95 KiB) Viewed 4133 times
museData has 2315 data points and museElements has 46 , which adds up to 2361, the number of data lines in the CSV file.

What do you get?

Re: Octave support?

Posted: Sat Jun 20, 2020 10:54 pm
by stargazer
What you showed is identical to what I got using Matlab 2019.

Using Octave I got
Screenshot from 2020-06-20 21-48-36.png
Screenshot from 2020-06-20 21-48-36.png (19.69 KiB) Viewed 4129 times
I modified the code to:

Code: Select all

...
  lineCounts = 0;
  while(!feof(fIn))
    line = fgetl(fIn);
    commas = length(strfind(line,','));
    if (commas==dataCommaCount)
      fprintf(fOutMD,'\n%s,',line);
    else
      fprintf(fOutME,'\n%s',line);
    endif
    lineCounts = lineCounts + 1;
  endwhile
  lineCounts
...
  museData = textscan(fIn,formatData,'HeaderLines',1,'Delimiter',',');
  museDataSize = size(museData)
And I got:
lineCounts = 2361
museDataSize =

1 38

The textscan function seems not functioning properly. This could be due to some setting issue from my side.

Re: Octave support?

Posted: Sat Jun 20, 2020 11:03 pm
by James
What version of Octave are you using?