Réponse apportée
extracting the last three characters from cell array
You probably want to extract the extension, instead of hard-coding the last three characters: data={'COD0MGXFIN_20210870000_01D...

presque 5 ans il y a | 1

Réponse apportée
Calculate mean from a cell array.
Two options of what you could mean: %load your data first websave('data.mat','https://www.mathworks.com/matlabcentral/answers/...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Assign values in the cell
You mean like this? output1={[1 2;3 4],[]}; L=cellfun(@isempty,output1); output1(L)={zeros(8,1)}; output1 Note that cellfun...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Right way to insert files paths into code
Personally I use a function like the one below to semi-hard-code the paths. The context for this is that I have a synced folder,...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
How can add stop button and command in GUI
The general solution is to have the stop button set a flag (either in the guidata or in the UserData property of an object). %i...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
string data type is not a class?
help methods This suggests that you can't use the methods(object) syntax for char and string inputs. methods('1') methods(cla...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
cell cal from function problem
If you pre-allocate the cell array you can use a comma separated list: [input1, input2, input3, input4]=deal(rand); AA=cell(...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Getting around overuse of "if" statements.
You should use the value of DAY to set the value of a variable you can use as the range. You should also use strcmp to compare c...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
How to calculate a median value of each interval?
%generate some random data temperature=15+10*rand(8767,1); phase=360*rand(size(temperature)); temperature_rounded=round(tem...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Have you figured out an easy way to publish your MATLAB projects for public consumption?
(this is not a drop-in solution) You could bundle your m-file with a copy of GNU Octave. The main upside is that it will be fr...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
How to plot the convolution of 2 functions
You didn't do the convolution on a function. However, since the vectors you did use are the y values of functions (with a shared...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
I want to load a folder in appdesigner by using "button" and to load the path of the folder in the "EditField". How?
The uigetdir function only has 1 output. folder = uigetdir(); if isequal(folder,0) ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
extracting all lines includes specific string from text file
You can get my readfile function from the FEX. %If you don't use the readfile function, you can use readlines instead readfile...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
Subtracting Current and Previous Value of the same variable
No,that is not possible. What you can do is create a new variable which contains the previous value of a. Then you can trivially...

presque 5 ans il y a | 0

Réponse apportée
Pause execution of While loop and resume from the same point with PushButtons App Designer
The reason for your issue is that you're using toc, which will still continue running. If you measure how long your GUI has bee...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
I want to compare two arrays and check that which value is missing in second array as compared to first one?
You should avoid variable names like sum, as that will prevent you from using the sum function. Your question sounds like you n...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Modifying a Variable if a condition is met
Array operation in Matlab tend to be much faster than other solutions. This is a situation where you can use logical indexing: ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Build a relation between matrix components
It is almost possible to use a convolution to solve your question, but I couldn't see how, so I did it with a replicated array. ...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
How to convert timestamp string to datetime object in matlab
UTC_epoch_seconds=1303133628; UTC_offset=UTC_epoch_seconds/(24*60*60); atomTime=UTC_offset+datenum(1970,1,1); datetime(atomTi...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
Edit field in app designer
app.spottedRegionsEditField.Value=N_objects; You need to put this in OpenButtonPushed (along with the code to calculate N...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
MCR version 7.15
<https://www.mathworks.com/products/compiler/matlab-runtime.html> Open MATLAB and run the command mcrinstaller to locate MATL...

presque 5 ans il y a | 0

Réponse apportée
How to pass 3 variables from a script into a function and get 1 output?
Where are the letters coming from? Anyway, if you want to do something like this, you should use strcmp to compare char arrays....

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How to arrange datetime vertically
Transpose should work as expected: (datetime(2012,02,01):datetime(2021,12,31)).'

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How can I find a faster way to calculate the transpose of a matrix?
The transpose is not required. You can use the second input to sum to change dimension along which it operates. Also, an abso...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Create a top hat function
If you realize that you are marking all true locations with 1 and leaving all false as 0, you can use that to make an anonymous ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Finding a string in a string
Split into groups of 3 (with mat2cell or with regexp), use ismember to find the position of each codon in a dictionary array (wh...

presque 5 ans il y a | 0

Réponse apportée
How to modify the y-axis tick label and tick values (2016a)
The trick is to select part of your YTickStr: L=round(linspace(1,size(YTickStr,1),5)); % use round to round to integer indices...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
Use of nested function in MATLAB app designer
You can use the callback functions of your buttons to replace the graphs and labels: function torquevsSpeedButtonPushed(app, ev...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
¿como transformo un vector a un polinomio para graficar la función?
doc polyval doc plot

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How can I plot (y vs t) and (z vs t) in one graph?
If you use array inputs to your anonymous function you can use the plot function.

presque 5 ans il y a | 1

| A accepté

Charger plus