Réponse apportée
Find max values within a defined range for each column and rows of a matrix
Turn into a timetable and use retime

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to recover unsaved matlab script if Matlab shutdown automatically?
See previous Answer https://www.mathworks.com/matlabcentral/answers/103130-does-the-matlab-editor-debugger-automatically-save-op...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Change the distance between boxplots
boxplot doesn't support variably-spaced box locations. use 'LabelOrientation','Horizontal' to maintain normal tick label orient...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
change in xlrange of xlsread while sing loop
That's the hard way to go at it...just read the spreadsheet into a table and operate over the regions of interest -- simple exam...

plus de 4 ans il y a | 0

Réponse apportée
Textscan import string data from .txt file
Read the file as is and then clean it up instead... d=readcell('202103.txt','Delimiter',newline); % read a cellst...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Matlab - problem with snr function
The two inputs have to have the same orientation as well as same length. You've created a row vector above for the noise while ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to preserve nanosecond precision in datetime calculations (for large numbers)
>> t='1294871257.002060945'; % treat long value as string >> dsec=seconds(str2double(ext...

plus de 4 ans il y a | 0

Réponse apportée
Is it possible to declare a char variable as global?
Seems to work just fine here -- although globals are fraught with danger, if you're cautious the above usage doesn't seem too eg...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Loop through folders to pick data file
You shouldn't be putting your data files under the MATLABROOT tree....that's fraught with difficulties when upgrade. MATLAB cre...

plus de 4 ans il y a | 0

Réponse apportée
I need to change n elements in an array chosen randomly
Not totally clear yet just what are valid locations to be changed -- the above code sets the diagonal elements to one anyways; i...

plus de 4 ans il y a | 0

Réponse apportée
How can I perform a set of calculations on multiple matrices located in a csv. file?
Those files have structure to deal with -- generically, one could read the header info and parse it to find out the content -- b...

plus de 4 ans il y a | 0

Réponse apportée
How to save fig in a different folder
mydir='yourfullyqualifiedpath'; savefig(figure(1),fullfile(mydir,'results','h.fig'),'compact'); The above also has the hardcod...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Create dir using greek symbol
Which OS/file system? Even if it is allowed by the above combination, I would strongly advise against doing so; it'll just lead...

plus de 4 ans il y a | 0

Réponse apportée
How do I import quarterly data from Excel
>> tQ=readtable('..\Answers\Data_QFE.xlsx'); >> tQ.Year=datetime(tQ.Year,'InputFormat','uuuuQQQ','Format','uuuuQQQ'); >> head(...

plus de 4 ans il y a | 0

Réponse apportée
What is this peak's meaning?
Or, it's just random noise or other non-meaningful artifact; we don't know for sure... How was the frequency axis created to ge...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Add x=y line to the scatter plot
hold on plot(xlim,ylim,'-b')

plus de 4 ans il y a | 2

| A accepté

Réponse apportée
Change scale of x-axis on plot
hAx=gca; hAx.XAxis.TickLabelFormat='%d'; hAx.XAxis.Exponent=0;

plus de 4 ans il y a | 0

Réponse apportée
Why do upsample and downsample commands give wrong results in start of sequence?
Don't know what the complaint is, precisely? upsample and downsample are working as documented -- >> upsample(1:4,3) ans = ...

plus de 4 ans il y a | 0

Réponse apportée
Help trying to manually insert peaks after findpeaks through a radio or push button please!
I'll let you deal with coding the callback to a button, but %...your above code here... hAx=gca; ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How exactly does MATLAB calculate a sum of array elements by its sum() function? Does it use any compensated summation algorithm such as Kahan?
TMW does not document publicly algorithms beyond anything provided in the documentation Description section or, occasionally an ...

plus de 4 ans il y a | 1

Réponse apportée
intersect between the second column of cell array A (for all rows) and the first column of cell array B (for all rows)
This may or may not be possible with simple syntax depending upon the content of the cell arrays...if it can work, [H,ih,ik]=i...

plus de 4 ans il y a | 0

Réponse apportée
how to merge 2 variable of different size?
With what expected as result, pray tell? You can't have a 2-column matrix of 25-elements; you could keep the two as elements in...

plus de 4 ans il y a | 0

Réponse apportée
making the x-axis and y-axis fixed for all plots
If you use x/ylim before plotting and then use plot, the auto-scaling will still be in effect for the axis and plot as the high-...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
I have a function "f" that returns a 1x2 vector, and I need to make a 3x2 matrix M by stacking the outputs f(x1), f(x2), f(x3) on top of each other, but Matlab won't parse it.
The first syntax will work if the function actually returns a vector -- >> x=rand(1,5); >> fnX=@(i)x(i:i+1); >> fnX(1) ans =...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
what does the "oldx =[x(n);oldx(1:256)]" in the following programm do?
It will (very inefficiently) append the first 255 elements of the (NEW and this is key) oldx vector onto the value of the read-i...

plus de 4 ans il y a | 0

Réponse apportée
Sorting cell for only dublicate values
Alternate approach to Jan's using features of categorical arrays (which the IDs logically are) % some dummy data of the same ty...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
I have a function (ex. adaptive) in a for loop which has two arrays as output. I want to save all the outputs in a single matrix. it can just save the last vector
You have to index the out arrays on the LHS of the assignment or MATLAB will, as you've observed, overwrite the whole variable o...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How can I index a duration variable
Always much easier if you attach the actual code you've used to get to this point and a little bit, at least of the data array. ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How do I pull out from a table, the total mean of one item based on a particular condition (for several subjects), and then compute the difference in mean values?
tMEANS=rowfun(@mean,tData,'GroupingVariables'{'ConditionZ'},'InputVariables','ItemA','OutputVariableNames','GroupedMeans'); See...

plus de 4 ans il y a | 0

Réponse apportée
Help creating loop that converts text to numbers
>> A='Now is the time...'; >> format short >> disp(double(A)) 78 111 119 32 105 115 32 116 104 101 ...

plus de 4 ans il y a | 0

Charger plus