Answered
Calculate daily mean of 30 minutes data
See Resample and Aggregate Data in Timetable Introduced in R2016b

7 years ago | 1

Answered
How to get a csv file excluding first row and last column to run through if statement?
fid is your file identifier data holds the data of the file in a cell array Thus replace the lines numrows = size(fid,1); ...

7 years ago | 0

| accepted

Answered
How to get row indices of matching pattern
Try %% I expanded the example with a couple of edge cases cac = { 'Standard', 'Manual', 250 'Standard', ...

7 years ago | 0

Answered
Class definition not updated after path change
I have reproduced the behavior on R2018a. The following script %% testClassUpdate clear all %% addpath ./Folde...

7 years ago | 0

Answered
Permute my center blocks
_"how make make my blocks into numbered blocks"_   Matlab does that automatically, e.g. >> Ablock(11) ans = ...

7 years ago | 1

| accepted

Answered
how to delete rows in cell array
Try %% I assume that your cell array is somewhat similar to this one cac = { 'a','b','c' [1],[2],[3] ...

7 years ago | 0

Answered
How to write to an existing column of a file?
*|AJ739_20170127115441_v2.daf|* is an UTF-8 encoded text file according to Notepad++. It's close to impossible to overwrite a...

7 years ago | 0

Answered
How to speed up calculation taking inputs from 2 separate and very large matrices (working code below)
Try >> cssm() Elapsed time is 0.073258 seconds. Elapsed time is 0.073459 seconds. Elapsed time is 0.042250 second...

7 years ago | 0

Answered
How to access sub-properties from an object array?
*Assuptions* * person is the array of objects * person has a property named, 'eye', the value of which is an eye-object *...

7 years ago | 0

Answered
Conditional properties in classdefs
Try put the calculations in the constructor and provide the model ID as input classdef DataML < ModelData propert...

7 years ago | 0

Answered
Trouble reading csv file
This hack reads and parses your file %% str = fileread( '7000.csv' ); iszero = double(str) == 0; str(iszero) =...

7 years ago | 0

| accepted

Answered
How to zoom subplots together?
See <https://se.mathworks.com/help/matlab/ref/linkaxes.html linkaxes, Synchronize limits of specified 2-D axes> The first exa...

7 years ago | 3

| accepted

Answered
divide matrix by a vector of the same number of column
I like this better. It avoids dividing by zero. ispos = B>0 C = A; C(:,ispos) = A(:,ispos) ./ B(ispos) Requires "I...

7 years ago | 1

Answered
Is there a way in MATLAB to make a boundary and have it skip over data pairs?
Documentation of the function, *|boundary(x,y)|*, says * *|x|* and *|y|* shall be column vectors * *|x|* and *|y|* shall be...

7 years ago | 0

| accepted

Answered
Vectorising a for loop that creates a 2-D surface for each point in a Domain
Matlab loops are faster than their reputation. I believe it's difficult to significantly outperform this function function...

7 years ago | 0

| accepted

Answered
Sum of N matrices
I've modified the example of my comment. %% n = 12; sz = [3,3]; MKG = nan( sz(1),sz(2), n ); for ix = 1 : ...

7 years ago | 0

| accepted

Answered
Problem with dlmread()
That depends on the format of your txt-files. Here is a simple case %% R2018a fid = fopen('rugged.txt'); cac = tex...

7 years ago | 0

| accepted

Answered
Function with 2 variables
See <https://se.mathworks.com/help/matlab/ref/log.html log, Natural logarithm> and try >> ZP=[-41 -45 -53]; SA=[0.001 0....

7 years ago | 0

Answered
An error (Two different outputs for a single command)
*|k_|* is a row vector, which explains why *|gamma|* becomes a row vector >> whos k_ gamma Name Size ...

7 years ago | 0

| accepted

Answered
how do i get the last points of every 100 points from a 1000 point graph
_"how do i get the last points of every [sequence of] 100 points from a [sequence of] 1000 point[s]"_&nbsp; That's my interpreta...

7 years ago | 0

| accepted

Answered
MatLab isn't reading the entirety of my data?
AFAIK: *|dir|* is the only function that takes wildcards in folder names. *Doc on |dir| says:* [...] To search through fo...

7 years ago | 0

| accepted

Answered
Singleton error causing mismatch?
Try replacing report(i,1)=props(i).name; by report(i,1)={props(i).name}; and see <https://se.mathworks.com/help...

7 years ago | 0

Answered
MYSTERY matlab Error - Index exceeds matrix dimensions - can't track it!
* *B is overwritten* at line 43 and the following loop. * In the second and the following iterations of the outer loop, *|t&gt;...

7 years ago | 0

Answered
Creating a class object with the same class name as a variable
You could create a function, *|factory|*, to communicate the intent. K = 'a1'; obj = factory( K ); where functio...

7 years ago | 0

Answered
Extracting parts of a string
Is this what you are looking for? %% fid = fopen( '00000090Head.txt', 'r' ); cac = textscan( fid, '%*s%f%*f%*f%*f%...

7 years ago | 1

Answered
Matrix indexing and plotting related doubt.
It seems as if you need to use *|squeeze|* to get a 2D matrix %% mat = zeros( 20, 50, 187 ); len = numel( mat ); m...

7 years ago | 0

Answered
Generate a Definite timestamp sequence
The old way >> vec = repmat([2018,3,1,0,0,0], 31*24*12, 1 ); >> minutes = ( 0 : 5 : 5*(31*24*12-1) )'; >> vec(:,5) = ...

7 years ago | 0

Answered
Plot: dealing with data available only on weekdays
I assume * *|X|* and *|Y|* have the same length * *|Z|* is shorter than *|X|* * *|Y|* and *|Z|* hold one value per day * ...

7 years ago | 0

Answered
Sum of base exponentials e
Matlab is clever >> 5*sum( exp(x1), 2 ) ans = 1.0e+04 * 5.545715485358022 0.017431824560524

7 years ago | 0

| accepted

Load more