Answered
How to change time interval in timeseries plot?
See resample - Resample timeseries time vector retime - Resample or aggregate data in timetable, and resolve duplicate or irre...

6 years ago | 1

| accepted

Answered
renaming certain part of a file
Try this %% xpr = '^[^.]+\.([^.]+)\.{2}\w+?(\w)\.\w+\.\d{4}\.(\d+)\.'; %% old_name = 'LM.BARI..BHZ.D.2018.246.000000.txt'; ...

6 years ago | 0

Answered
Stuck at a For Loop
Notes from my debugging session: added your assignments of input values to the top of the script commented out the input() sta...

6 years ago | 0

Answered
Count Unique Occurrences of Elements
I cannot make comments, thus I use an Answer To ensure that Stops, Buses and UniqueBuses are row vectors add the following li...

6 years ago | 1

Answered
Count Unique Occurrences of Elements
Try this %% Stops = [ "w", "w", "x", "x", "x", "y", "z" ]; % String Buses = [ "A", "B", "C", "A", "C", "D", "B" ]; % Stri...

6 years ago | 1

| accepted

Answered
Optimized code for loop, If-statement for large dataset
Try this %% ixcol = [ 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19 ]; n=0; for i = 1 : length(d_A) if all( isnan( d_A( i...

6 years ago | 0

| accepted

Answered
A problem about using %f
Try this %% K = randi( [1e9,9e9], 1,9 ); % sample data %% cac = arrayfun( @(x) num2str(x), K, 'uni',false ); %% str = stri...

6 years ago | 0

| accepted

Answered
Listing only a certain value in from text file
Try this %% chr = fileread('cssm.txt'); %% cac = regexp( chr, '[\d\.]+(?=[\t\r ]*$)', 'match', 'lineanchors' ); num = str2d...

6 years ago | 0

Answered
Handling large data sets
Idea : Version 7.3 MAT-files are HDF5-files. Matlab has functions to read HDF5-files, Importing HDF5 Files. The tricky pa...

6 years ago | 0

Answered
Something is nuts. Why would a working script stopped working???
The line before is in error (the brackets aren't balanced) FileToSave=[FileToGet(1:end-4) ['.jpg'] The Code Analyzer box p...

6 years ago | 0

| accepted

Answered
fprintf - a troubling question
See Export Binary Data with Low-Level I/O . You should use fwrite(), not fprintf()

6 years ago | 0

Answered
How do I "use structures for function arguments"?
Try this S.x1 = 17 ; S.x2 = 18 ; S.text1 = 'ABC'; S.cmap1 = magic(3); S.cmap2 = magic(3); S.cmap3 = magic(...

6 years ago | 0

| accepted

Answered
Access to data without reading all of it
"I am slightly confused about the comments about search algorithm. [...] Is find function in Matlab not very efficient?" I'm co...

6 years ago | 0

| accepted

Answered
Error: Dot indexing is not supported for variables of this type.
I cannot reproduce your problem. This works %% parameter.A = []; a = ones(1,5); parameter.A = [parameter.A; a]; b = 2*ones...

6 years ago | 0

| accepted

Answered
MATLAB takes too long time to find solution
See Profile to Improve Performance I let your code run for a minute with the profiler active. There are a lot of warnings l...

6 years ago | 0

Answered
importing large 4GB+ tab-delimited ascii file makes MATLAB crash
That's strange. I use Win10 and R2018b (64bit). btw: What do you mean by "[...] up in complexity" ? Anyhow try >> num = cssm( ...

6 years ago | 0

Answered
Change marker size in legends of already plotted figures
Short answer: The behavior described in the stackoverflow thread is based on an undocumented feature. I've reproduce your obse...

7 years ago | 1

Answered
eliminate several columns and rows of a matrix using vectors.
Try >> m = magic( 5 ) m = 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 ...

7 years ago | 0

| accepted

Answered
Uneven spacing between texts in command window?? help!!!
Try to use a fixed-width font

7 years ago | 0

| accepted

Answered
I would to save the values for post processing from file output, can you help me?
Try this >> num = cssm('h:\m\cssm\postprocessing.txt') num = 3.15 where the file, cssm.m, contains the following c...

7 years ago | 1

| accepted

Answered
average and standard deviation of one column of a matrix
See std - Standard deviation mean - Average or mean value of array

7 years ago | 0

| accepted

Answered
How do I use if with the value of the array is a string?
Replace if f == 'NaN' by if isnan( f )

7 years ago | 0

| accepted

Answered
Help with REGEXP: extracting info from a fragment of URL inside the HTML code.
"Keep in mind that regular expressions are not a robust or neat way to parse HTML:" Anyhow, it can be used as an exercise on re...

7 years ago | 1

| accepted

Answered
Underscore doesn't work for step legend
With R2018b. Deep inside and after too many if-statements to keep track of a backslash is added. C:\Program Files\MATLAB\R201...

7 years ago | 3

Answered
creating a dynamic variable name based on cell array
"I know this is not recommended" This is one way. I think it looks a bit cleaner and is easier to use than eval() assign( myCh...

7 years ago | 2

| accepted

Answered
print cell elements with fprintf
The values of cell one, time{1}, and the rest, time{2:end}, are of different types >> time{1:2} ans = uint32 20579000 ...

7 years ago | 1

| accepted

Answered
Summing without nested loops
The loops are still there, but this is significantly faster. Comments: The calculation of besselj() dominated the use of time...

7 years ago | 1

| accepted

Answered
How do I read a block of data from excel sheet and store it in an array?
This solution uses a containers.Map rather than a cell array because I think there might be gaps in the flight_list. See contai...

7 years ago | 0

| accepted

Answered
How to convert a cell array of structs into a table?
So far so good. What to do with the field, "photos"? >> S=data.messages; >> sas = [S{[1:10]}]; >> struct2table(sas) ans = ...

7 years ago | 0

Answered
express function as function handles
See Create Function Handle and try fh = @dint2; What's density() ?

7 years ago | 0

Load more