Answered

how to replace multiple values per second with their standard deviaton?

Read the doc more carefully... TT2=retime(TT,'secondly',@std)

how to replace multiple values per second with their standard deviaton?

Read the doc more carefully... TT2=retime(TT,'secondly',@std)

circa 17 ore ago | 0

| accepted

Answered

I need to plot a Dynamic scattered plot. I have vector x and y, and those are coordinates. I need to plot coordinate 1, and then coordinate 2 but coordinate 1 must need to still there.

h = animatedline('Marker','none'); There's your problem... array=readmatrix('laser_data.csv'); % no point in a tab...

I need to plot a Dynamic scattered plot. I have vector x and y, and those are coordinates. I need to plot coordinate 1, and then coordinate 2 but coordinate 1 must need to still there.

h = animatedline('Marker','none'); There's your problem... array=readmatrix('laser_data.csv'); % no point in a tab...

1 giorno ago | 0

| accepted

Answered

How to search for header name and only pull that column as an array you can multiply

If you loaded the .csv into a table with headers that are variable names, you don't need to search nor "pull" data -- just refer...

How to search for header name and only pull that column as an array you can multiply

If you loaded the .csv into a table with headers that are variable names, you don't need to search nor "pull" data -- just refer...

2 giorni ago | 0

| accepted

Answered

Plotting a figure with bars in stack

Any number of ways; a braind-dead sample y=sort(rand(20,2),1,'ascend'); % some dummy y data figure,hold on ...

Plotting a figure with bars in stack

Any number of ways; a braind-dead sample y=sort(rand(20,2),1,'ascend'); % some dummy y data figure,hold on ...

3 giorni ago | 0

| accepted

Answered

Particularly strange bug using the eval function

From the doc-- Whenever possible, do not include output arguments within the input to the eval function, such as eval(['outpu...

Particularly strange bug using the eval function

From the doc-- Whenever possible, do not include output arguments within the input to the eval function, such as eval(['outpu...

4 giorni ago | 2

Answered

How do I erase string duplicates in one column of a cell array and add the strings' corresponding numbers in the second column?

>> c c = 6×2 cell array {'Sarah' } {[12]} {'Marie' } {[ 3]} {'Sam' } {[ 5]} {'Rose' } {[ ...

How do I erase string duplicates in one column of a cell array and add the strings' corresponding numbers in the second column?

>> c c = 6×2 cell array {'Sarah' } {[12]} {'Marie' } {[ 3]} {'Sam' } {[ 5]} {'Rose' } {[ ...

4 giorni ago | 1

Answered

Why do my FFTs look wildly different?

Above just based on the figures; reading the m file reveals a major problem -- you only processed the first N = 1024 points of ...

Why do my FFTs look wildly different?

Above just based on the figures; reading the m file reveals a major problem -- you only processed the first N = 1024 points of ...

5 giorni ago | 0

Answered

Error: File: t2_m1.m Line: 46 Column: 8 The input character is not valid in MATLAB statements or expressions.

Unrecognized function or variable 'material_1'. >> material_1=rand(10,120); >> x = (2:2:120); c_1 = material_1(:, x); vf_1 ...

Error: File: t2_m1.m Line: 46 Column: 8 The input character is not valid in MATLAB statements or expressions.

Unrecognized function or variable 'material_1'. >> material_1=rand(10,120); >> x = (2:2:120); c_1 = material_1(:, x); vf_1 ...

5 giorni ago | 0

| accepted

Answered

Plotting several .txt files

... fullFileName = fullfile(theFiles(k).folder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); plot(fullFileNam...

Plotting several .txt files

... fullFileName = fullfile(theFiles(k).folder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); plot(fullFileNam...

5 giorni ago | 0

| accepted

Answered

Matrix addition in a loop in a random column

Must reference the same size section of array on LHS of an assignment as the RHS unless assign the entire LHS variable to RHS. ...

Matrix addition in a loop in a random column

Must reference the same size section of array on LHS of an assignment as the RHS unless assign the entire LHS variable to RHS. ...

5 giorni ago | 0

Answered

Carry trade portfolio with 20 countries

That was kinda' fun!!! :) % create some sample data...use a table for convenience tPort=[ table(datetime(1997,0:20,1,'For...

Carry trade portfolio with 20 countries

That was kinda' fun!!! :) % create some sample data...use a table for convenience tPort=[ table(datetime(1997,0:20,1,'For...

6 giorni ago | 0

Answered

Creating a built in function?

Don't put it on the Desktop, create a folder in your user area for MATLAB and then add that folder to the MATLABPATH and make pe...

Creating a built in function?

Don't put it on the Desktop, create a folder in your user area for MATLAB and then add that folder to the MATLABPATH and make pe...

8 giorni ago | 1

| accepted

Answered

How do you get multiple minimum values in a column based on grouping and then isolate the corresponding rows for the whole table?

[g,ig]=findgroups(data.names); b=splitapply(@(x) {maxk(x,10)},data.age,g); b contains the k oldest elements for each group...y...

How do you get multiple minimum values in a column based on grouping and then isolate the corresponding rows for the whole table?

[g,ig]=findgroups(data.names); b=splitapply(@(x) {maxk(x,10)},data.age,g); b contains the k oldest elements for each group...y...

8 giorni ago | 0

| accepted

Answered

peak in fixed interval in findpeaks

There simply isn't much in the way of a peak to find -- I can't discern enough even by eye to count to eleven in that trace... ...

peak in fixed interval in findpeaks

There simply isn't much in the way of a peak to find -- I can't discern enough even by eye to count to eleven in that trace... ...

8 giorni ago | 0

| accepted

Answered

Reduce the distance between boxplots

Carrying on from the above idea... data=rand(10,16); % just some random data w/ 16 variables/columns data2=[]; for i=...

Reduce the distance between boxplots

Carrying on from the above idea... data=rand(10,16); % just some random data w/ 16 variables/columns data2=[]; for i=...

9 giorni ago | 1

| accepted

Answered

How to label Y axes in place of column1 column 2 etc

YT=cellstr(datetime(2020,1:12,1,'Format','MMMyy')); % cellstr array of MMMyy hSP=stackedplot(YT.','DisplayLabels',YT); ...

How to label Y axes in place of column1 column 2 etc

YT=cellstr(datetime(2020,1:12,1,'Format','MMMyy')); % cellstr array of MMMyy hSP=stackedplot(YT.','DisplayLabels',YT); ...

9 giorni ago | 0

Answered

Is it possible to write the function (mathematical formula) of a custom probability distribution from data?

To generate a functional form totally independently from only a dataset is pretty much not feasible. There are a number of gene...

Is it possible to write the function (mathematical formula) of a custom probability distribution from data?

To generate a functional form totally independently from only a dataset is pretty much not feasible. There are a number of gene...

9 giorni ago | 0

Answered

Draw a colored error map based on the measurement error

More than one way to skin a cat... :) hHM=heatmap(reshape(RMSE,6,6)); % draw the heatmap; fixup some to draw on top...

Draw a colored error map based on the measurement error

More than one way to skin a cat... :) hHM=heatmap(reshape(RMSE,6,6)); % draw the heatmap; fixup some to draw on top...

9 giorni ago | 1

| accepted

Answered

How to sort a table (only 2 rows)

[~,imin]=min(T.value); [~,imax]=max(T.value); T=[T(imin,:); T; T(imax,:)]; T([imin,imax],:)=[]; Or, save the two rows of int...

How to sort a table (only 2 rows)

[~,imin]=min(T.value); [~,imax]=max(T.value); T=[T(imin,:); T; T(imax,:)]; T([imin,imax],:)=[]; Or, save the two rows of int...

9 giorni ago | 0

Answered

How to load multiple files sequentially with no standard extension into MATLAB at once

If you place them all in a clean directory, then d=dir(fullfile('TheBearingDataSetDirectory','*.*')); will return all in a dir...

How to load multiple files sequentially with no standard extension into MATLAB at once

If you place them all in a clean directory, then d=dir(fullfile('TheBearingDataSetDirectory','*.*')); will return all in a dir...

10 giorni ago | 0

Answered

How can i set legend for different bar with different colors?

As per usual (despite some much-needed belated improvements on at least being able to label a bar, thanks! TMW) bar is still a r...

How can i set legend for different bar with different colors?

As per usual (despite some much-needed belated improvements on at least being able to label a bar, thanks! TMW) bar is still a r...

11 giorni ago | 0

Answered

Combine three columns with comma for a lot CSV files

fileDir = 'D:\Examps'; d=dir(fullfile(fileDir,'*.csv'); for i = 1:numel(d) data=readmatrix(fullfile(fileDir,d(i).name),'Num...

Combine three columns with comma for a lot CSV files

fileDir = 'D:\Examps'; d=dir(fullfile(fileDir,'*.csv'); for i = 1:numel(d) data=readmatrix(fullfile(fileDir,d(i).name),'Num...

13 giorni ago | 0

| accepted

Answered

MATLAB Answers Wish-list #5 (and bug reports)

Who's idea to introduce the black background for code? I can read almost nothing now easily with the small contrast between the...

MATLAB Answers Wish-list #5 (and bug reports)

Who's idea to introduce the black background for code? I can read almost nothing now easily with the small contrast between the...

13 giorni ago | 0

Answered

Error with Uniquetol: " Repetitive numbers not being removed"

Yeah, fix the magnitude of the tolerance interval you want distinguished--by default uniquetol(A) uses 1e-6 for single-precision...

Error with Uniquetol: " Repetitive numbers not being removed"

Yeah, fix the magnitude of the tolerance interval you want distinguished--by default uniquetol(A) uses 1e-6 for single-precision...

17 giorni ago | 0

Answered

Find indices of elements for given difference

find and/or ismember will only return EXACT matches -- will NOT return something "on or about" a 10 ms interval. Two possibilit...

Find indices of elements for given difference

find and/or ismember will only return EXACT matches -- will NOT return something "on or about" a 10 ms interval. Two possibilit...

17 giorni ago | 0

Answered

How to save multiple matrix in a .dat file

DON'T EVEN THINK OF IT!!! From the documentation... Use one of the text formats to save MATLAB numeric values to text files. I...

How to save multiple matrix in a .dat file

DON'T EVEN THINK OF IT!!! From the documentation... Use one of the text formats to save MATLAB numeric values to text files. I...

17 giorni ago | 0

Answered

can meaning of ~= be "equal to" ?

Since MATLAB array counting is 1-based, have to move up by one from the 0-based counting. The solution produces the expected re...

can meaning of ~= be "equal to" ?

Since MATLAB array counting is 1-based, have to move up by one from the 0-based counting. The solution produces the expected re...

19 giorni ago | 0

Answered

Locating characters in a string array

OK, got the electrical problem in stable state for time being with power back the main well so cattle are drinking...shop not on...

Locating characters in a string array

OK, got the electrical problem in stable state for time being with power back the main well so cattle are drinking...shop not on...

20 giorni ago | 0

Answered

How to vectorize this for loop

Bundle(:,6)=sum(Bundle(:,1:4).*cost_bundle,2); % cost per account Bundle(:,7)= seguranca*tax*(sum(Bundle(:...

How to vectorize this for loop

Bundle(:,6)=sum(Bundle(:,1:4).*cost_bundle,2); % cost per account Bundle(:,7)= seguranca*tax*(sum(Bundle(:...

20 giorni ago | 1

| accepted

Answered

How to vectorize this for loop

i = 1:length(Bundle); Bundle(i+n,6) = ( Presuming Bundle is taller (more rows) than wide (columns), the above unless n=0 wil...

How to vectorize this for loop

i = 1:length(Bundle); Bundle(i+n,6) = ( Presuming Bundle is taller (more rows) than wide (columns), the above unless n=0 wil...

20 giorni ago | 0