[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Format of mat file
From: |
Rich Lakey |
Subject: |
Format of mat file |
Date: |
Tue, 25 Dec 2018 16:19:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
just getting started and have
M=csvread('file.csv')
and then
save('file.mat','M')
File looks ok but cannot find description of what it should look like.
First few lines:
# Created by Octave 4.2.2, Tue Dec 25 15:27:10 2018 CST <address@hidden>
# name: M
# type: matrix
# rows: 1258
# columns: 1
1833.3199
1842.02
1841.4
1841.0699
The data starts in column 2 or is the first column zero? Should my data
be in the fist column? Do I reference data starting in row 1 or 6 after
the header info. I'm assuming Octave skips the header info and treats
row 6 as 1.
My program seems to run ok but no output. I suspect I am not reading the
data from the file. Using a blank file the results are the same, program
runs but no output.
The start of my program loads the file as:
% Part 1
load file.mat
for i=1:1258
x(i) = i;
end
p1 = polyfit(x', file(1:1258), 3);
xx = (1:1:1358)';
pp1 = polyval(p1, xx);
plot(xx, NFLXdata)
hold
I can run commands and get the samples in documentation to work, but I
am missing something with inputting data from file.
Rich
- Format of mat file,
Rich Lakey <=