All Questions
574 questions
0
votes
1
answer
40
views
Saving path when Importing Data using MATLAB's default GUI
My MATLAB scripts live in the Matlab installation dir, while my data files live on other HDDs. When I run my scripts and import data via uigetfile, I save the path to the most recently imported data (...
0
votes
1
answer
100
views
Load file into MATLAB
Instead of my script asking the user the number of coordinate points and then to type them, I wanted the user to type the name of a file and the file to be read.
The file looks like this:
1 2
4 6
7 3
...
0
votes
0
answers
32
views
problem in writing data and matrix elements into text file
I have a problem with writing data to a file in Matlab, I have an LP problem that their solution is a vector of size n, and I want to write some information about this solution in a text file to read ...
1
vote
1
answer
456
views
Create Dynamic structure variables and save them
For my program input is a csv file with some variable names and their values.
| var name | value |
| -------- | -------------- |
| a.b | 345 |
| a.c._0_....
0
votes
1
answer
228
views
Creating a valid filename with dir and fullfile
I keep running across this error in my code:
Path = 'C:\Users\18606\OneDrive\Documents\Spheroids For Brandon\Spheroids\1-8WT';
Content = dir(Path);
SubFold = Content([Content.isdir]); % Keep only the ...
0
votes
0
answers
55
views
Performance: finding newest file in folder
I am trying to (very quickly) find the newest file in a folder under Windows. I'm using Matlab, but solutions using .NET may be useful, as I can probably use that from within Matlab.
The problem here ...
3
votes
2
answers
567
views
Write binary file to disk super fast in MEX
I need to write a large array of data to disk as fast as possible. From MATLAB I can do that with fwrite:
function writeBinaryFileMatlab(data)
fid = fopen('file_matlab.bin', 'w');
fwrite(fid, ...
1
vote
1
answer
297
views
How can I read in multiple text files and merge them together based on Timestamps in the filename
I have a folder that contains lots of text files that each contain 6 headers along with the data I'm looking to read in:
Phone timestamp;sensor timestamp [ns];channel 0;channel 1;channel 2;ambient
...
0
votes
1
answer
56
views
How can I read specific images from TID2013 dataset in MATLAB?
How can I read specific images from TID2013 dataset in MATLAB? I written the following code but it start from first to end of the list. The images are in this format: ixx.yy.z.bmp means xx is the ...
0
votes
1
answer
313
views
approach to save and load a 3D matrix
I need to save a 3D matrix in a text file that will be loaded in Matlab (which I don't master). My first idea was to do it with a .csv like this, (consider a 3x3x3 matrix):
row 1: v[0][0][0],v[...
1
vote
2
answers
130
views
Matlab: how to export "date time" data to an external file? "Error using fprintf. Function is not defined for 'cell' inputs."
I'm running Matlab 2016a and I'm a bit of a newbie.
I imported certain columns of data from a very large external .txt file. The first column is "date time." When I print it to screen, ...
2
votes
1
answer
3k
views
How to save Python 1D, 2D or 3D NumpPy array into MATLAB .mat
Python's SciPy package has a function that saves Python variable into MATLAB's .mat file
https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.savemat.html
However, the documentation lacks ...
0
votes
1
answer
131
views
How to modify data in MatLab code to be csv file
I have this following graph.
graph I created in code
Currently, it works using this following data in MatLab code:
function [] = TestKShortestPath(case_number)
switch case_number
case 1
...
3
votes
1
answer
397
views
MATLAB fwrite with skip slow
I'm writing some larger (~500MB - 3GB) pieces binary data in MATLAB using the fwrite command.
I want the data to be written in a tabular format so I'm using the skip parameter. E.g. I have 2 vectors ...
0
votes
0
answers
113
views
Read text file with multiple rows of fields
I am trying to read in a large text file with a challenging formatting. Instead of one long row of many fields, the file is broken into chunks with multiple rows of fields. Additionally, the headers ...