Réponse apportée
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...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
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... ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
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=...

presque 6 ans il y a | 2

| A accepté

Réponse apportée
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); ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 6 ans il y a | 0

Réponse apportée
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...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 6 ans il y a | 0

Réponse apportée
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...

presque 6 ans il y a | 0

Réponse apportée
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...

presque 6 ans il y a | 0

Réponse apportée
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...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
[DISCONTINUED] 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...

presque 6 ans il y a | 0

Réponse apportée
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...

environ 6 ans il y a | 0

Réponse apportée
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...

environ 6 ans il y a | 0

Réponse apportée
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...

environ 6 ans il y a | 0

Réponse apportée
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...

environ 6 ans il y a | 0

Réponse apportée
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...

environ 6 ans il y a | 0

Réponse apportée
How to vectorize this for loop
Bundle(:,6)=sum(Bundle(:,1:4).*cost_bundle,2); % cost per account Bundle(:,7)= seguranca*tax*(sum(Bundle(:...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 6 ans il y a | 0

Réponse apportée
How to change Y-axis in histfit plot from counts to percents?
hHF=histfit(myVec); Vtot=sum(myVec); arrayfun(@(h) set(h,'YData',h.YData/Vtot),hHF) ... or, w/o the temporary, hHF=histfit(...

environ 6 ans il y a | 0

Réponse apportée
How to adjust the position of a title in a subplot
It's the axis equal that does it -- take out the axis off afterwards and you'll see the position of the title isn't all that fun...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Median(here it's middle ) of vector/array of every two adjacent values in array (value(i+1)-value(i)).
Not so sure why this would be puzzling... tm=diff(t)/2; You have one few differences than elements of t, of course.

environ 6 ans il y a | 0

Réponse apportée
How to transform time series into frequency dimain and obtain amplitude and phase
There's really nothing wrong with the code; you have followed the example from the documentation for FFT and the following lines...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Count words from wordlist in a text
Start @ <Analyze-text-data-with-string-arrays> You may also find ismember of interest for the last...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Breaking data from a large text file into groups
Well, the following is pretty easy as far as counting goes...how it works on real file as far as speed and whether need to read ...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Error Explanation Error: File: C.m Line: 169 Column: 5 This statement is not inside any function. (It follows the END that terminates the definition of the function "readeph".)
I edited the function for you ...starting with fixing the indention to be consistent by block...which shows when you get back to...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
How to define the data type of each column in a struct?
MATLAB is amorphous on type -- everything is stored as the type of the RHS on assignment unless directly addressing the element ...

environ 6 ans il y a | 0

| A accepté

Réponse apportée
Put the name in the "x axis" of the graph bar every five days or seven days
Well, if you say so... :) tEnersol=readtable('enerosolar.xlsx','Sheet','EneDic'); % read into a table object tEnersol.Propert...

environ 6 ans il y a | 1

Réponse apportée
Put the name in the "x axis" of the graph bar every five days or seven days
Don't put the ticks every day; that's the cause for there being that many--you did it to yourself! :) The bar() command will p...

environ 6 ans il y a | 1

| A accepté

Réponse apportée
Is there maximum number of characters of the figure title latex interpreter string?
First, you must pass a char() string, not cellstr. You've got too many $ signs for pieces, but a start at what outlined above us...

environ 6 ans il y a | 0

Réponse apportée
Access data within timerange
The timerange object is another of those opaque thingies TMW has fallen in love with that has useful stuff inside it that is hid...

environ 6 ans il y a | 3

| A accepté

Charger plus