Community Profile

photo

Jeremy Hughes

MathWorks

Last seen: Today Active since 2015

Software Developer, Musician and Science Fiction Writer.

Statistics

All
  • Personal Best Downloads Level 1
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 4
  • First Submission
  • Knowledgeable Level 3
  • 6 Month Streak
  • Revival Level 1
  • First Answer

View badges

Content Feed

View by

Answered
How to use textscan with empty char fields
The format specifier %c always reads one character, no matter what that character is. What you likely want it %s, which reads al...

11 Tage ago | 1

| accepted

Answered
Convert serial number date in date string - Excel file
First, I would suggest using readcell if you want to get datetimes. This will give you the right thing by default. Otherwise, c...

13 Tage ago | 0

Answered
readmatrix not working in 2021b
I agree with the previous answer, but readmatrix is probably not what's being shadowed. It's probably something readmatrix relie...

28 Tage ago | 0

| accepted

Answered
how to read mixed date and data
I made some corrections in the comments above, but this is how I would do this more robustly using partial detection with detect...

2 Monate ago | 0

| accepted

Answered
use of readtable to read unstructured data
Based on the file attached, I suggest treating this as a fixed width file. opts = detectImportOptions("sample.txt","FileType","...

2 Monate ago | 0

Answered
How to delete multiple rows from a table using a for loop (with a condition)?
I wouldn't use a for loop. MATLAB excells at array operations. A = randn(12,5); % Make some data with positive and negative v...

3 Monate ago | 0

| accepted

Answered
Why are there a few bytes added every time I call writetable?
writetable write "into" a sheet by default. And there's some meta-data being added, but I'm not sure if it's MATLAB, or the exce...

3 Monate ago | 0

| accepted

Answered
Unable to detect datetime or duration data in file for row times
Hi Sangani, This is a consequence of how Excel stores "time" data. It represents it as a "number" internally, with a custom for...

3 Monate ago | 1

| accepted

Answered
{0*0 char} error while Importing .dat file
Instead of readtable and table2array, you could instead use readmatrix (as of R2019a) directly. The reason some of the columns...

3 Monate ago | 0

| accepted

Answered
readmatrix command not working
This looks like an installation issue to me. Something is missing/broken causing initialization error in the internal code. Doe...

3 Monate ago | 0

Answered
Reading .txt with multiple delimiters
Readtable accepts multiple delimiters. Try this: T = readtable(filename,"Delimiter",[" ","|"])

4 Monate ago | 0

Answered
readtable not reading logical values as expected
The default results of detectImportOptions seeing "1" & "0" will be numeric, and the default logical reading expects "true","t" ...

4 Monate ago | 1

| accepted

Answered
why "writetable" replaces points with commas ???
@Walter Roberson, @Peter PerkinsYou're both right. Walter is more right. An XLSX file is a zip file containing XML data which ...

4 Monate ago | 0

Answered
Importing 4D Excel data sets
You might try readcell. It will at least give you all the data. You will have to restructure it to get the format you'd like.

4 Monate ago | 0

Answered
Program architecture for handling large .csv files
First, it would help to see an example file, and some sample code that demonstrates the problem. Here's the best I can say wit...

4 Monate ago | 0

Answered
how to use setvartype on a table that is already existing
This will do what you're literally asking for. T = array2table(strings(200,0)) % 200 variables, 0 rows, all string type But I ...

4 Monate ago | 0

| accepted

Answered
Problem with readtable MATLAB R2020a+
My best guess is that there's something installed on the path that conflicts with a function//variable that readtable is using i...

5 Monate ago | 0

| accepted

Answered
Error csvread() numeric field -> *i
It it weren't for the "*" character this would work. Something like "1-2i" will be read as complex numbers. If you have contro...

5 Monate ago | 0

Answered
For loop to replace n/a with NaN in a table
What does this do? data= readtable("Wetland_Water_Quality_data_1.csv","TreatAsMissing","n/a");

5 Monate ago | 0

Answered
CSV file reading and applying loop to plot graphs
Without an example file, it's impossible to say why the code doesn't work as expected. I'm just working backwards from the error...

6 Monate ago | 0

| accepted

Answered
CSV file reading and applying loop to plot graphs
You should look at what nhdr is when you see the error. It's likely an empty value which makes nhdr+2 empty, and [nhdr+2 inf] ju...

6 Monate ago | 0

Answered
ReadTable Producing ExtraVar Headers
Main issue is that the sample code is a bad practice. Once created by detectImportOptions, the options don't get updated based o...

6 Monate ago | 0

| accepted

Answered
Mixed character Tab delimited csv file read in
Ahhh, that's because the data is in quotes. readmatrix assumes quoted data is meant to be preserved, so the only way to get tha...

6 Monate ago | 1

Answered
Mixed character Tab delimited csv file read in
Just a note: CSV means comma-separated-values, but if this is TAB separated, it's not really CSV. If the data in the sections a...

6 Monate ago | 0

Answered
xlsread isn't storing all the cell values from a column
The issue is in the call to readcell which isn't using the correct syntax. See readcell documentation for details. It looks lik...

7 Monate ago | 0

Answered
Quick question regarding CSV file reading.
I'd do this: opts = detectImportOptions('cycle1.csv','Delimiter',',','VariableNamingRule','preserve'); opts.SelectedVariableNa...

7 Monate ago | 0

Answered
read csv file with dates and numerical in R2016b
Try this: opts = detectImportOptions(filename) T = readtable(filename,opts);

7 Monate ago | 0

Answered
xlswrite substitute that writes to specific columns
This syntax is equivalent to writematrix(A,filename,'Range',xlRange)

8 Monate ago | 1

| accepted

Answered
How to import several csv files (Nan,numeric,text) for operate with them after
I suggest readtable.

8 Monate ago | 1

| accepted

Answered
Find and replace (overwriting) to the middle of an existing binary file
fopen(filename,'a') % append mode https://www.mathworks.com/help/matlab/ref/fopen.html#btrnibn-1-permission Then use fseek to ...

8 Monate ago | 0

| accepted

Load more