Answered
How can I find the same value by using cellfun?
condition = {[11,1],[11,1],[12,2],[12,2],[11,1]}; idx = cellfun(@(v)isequal(v,[11,1]),condition); Your code didn't work bec...

6 jours ago | 1

Answered
How to add another plot to box plot?
Summary of comments under the question The problem was that the x axis limit was [0,1] while the plotted data were at x=2. Th...

6 jours ago | 1

Answered
How to sort filenames that are stored by dir command
This uses regular expressions to extract the file number in the pattern file###. If that pattern is not found, the file number ...

7 jours ago | 0

Answered
How to extract data corresponding to a date and time?
Here's how to get the indices of the datetime array that are within +/- 1 hour of the target time. % Create datetime array t...

7 jours ago | 0

| accepted

Answered
Plotting on GUI and navigate between the figures
Summary of the comments under the question: Instead of using the [<<] and [>>] buttons to toggle through various data sets that...

7 jours ago | 0

| accepted

Answered
adding single quotation to a string
filename = sprintf('"%s"',string(extractBetween(filename, "Scans\\", filename(end)))); Result: filename2 = '"GComScan_2020011...

7 jours ago | 0

| accepted

Answered
File association does not work for R2019b installed on Windows 10
If you're referring to Matlab file associations in Windows such as m-files not openning in MATLAB or opening up in a new instanc...

7 jours ago | 0

Answered
Finding the percentage of NaN cells in columns
Using the C.mat file from your previous questions, here's a simple way to produce the table you're describing. load('C.mat'); ...

7 jours ago | 1

Answered
How to read this date format yyyymmddHHMMSS.SS ?
Datetime values are much better than datenum values. Nevertheless, here's how to convert your datestrings to both. % Date str...

7 jours ago | 1

| accepted

Answered
How to export Excel files to the specific folder?
Use the fullPath = fullfile(path, filename) function to create full paths to files. This offers a number of very important bene...

7 jours ago | 2

| accepted

Answered
Grid overlay on "plots()"
Here are two ways of adding a grid to a plot. Use the grid function Use grid on to turn on the axis grid where a grid line wi...

7 jours ago | 0

Answered
PARULA colormap when working with point cloud data
The colors of a colormap do not have any inherent meaning. They are merely scales that cover the range of your data or whatever...

8 jours ago | 0

| accepted

Answered
Heatmap seems to delete axes component
In reference to this part of your quesiton: ax=axes(handles.axes2) h1 = heatmap(ax,B); h1.Colormap = cool; h1.Cell...

8 jours ago | 0

| accepted

Answered
how to show/hide colorbar by using menu
This line below should throw an error (r2019b). get(colorbar,'enable','off') Error using matlab.graphics.illustration.ColorB...

8 jours ago | 0

Answered
Add error bars in bar graph
Here's a demo you can follow to add error bars to a grouped bar chart. To center the errorbar on each bar, you need to compute ...

8 jours ago | 1

| accepted

Answered
Error using str = input(prompt,'s')
The problems with using input() The use of input() can be problematic since the range of inputs the user can intentional or uni...

8 jours ago | 1

Answered
How to fill blank cells in the table using filled cells in the same column?
This simple, easy-to-read loop fills the missing elements in the first 4 columns of each table with the nearest non-missing elem...

8 jours ago | 1

| accepted

Answered
how to stop continuous pop up of figures
The figures are being created somehwere in the file or from a function being called from within the file. You'll need to make c...

8 jours ago | 0

Answered
Why delete(findobj(gca,'type', 'patch')) is not working for erasing scattered points ?
"Why delete(fin​dobj(gca,'​type', 'patch')) is not working for erasing scattered points ?" Because s = scatter(___) produces a ...

8 jours ago | 1

| accepted

Answered
Checking each element in a vector
Note, we don't know what h, s, and g are but I'm guessing they are numeric vectors of the same size as v in which case, either o...

8 jours ago | 0

| accepted

Answered
Permuting elements in an symmetrical matrix with restricted outcomes
Since the permuted matrices are all symmetric, you really only need to permute the lower (or upper) triangle of the matrix, excl...

8 jours ago | 0

| accepted

Answered
About logical calculation. Is this a bug?
The operation p_grad = 1.1200e-17; -1 < p_grad < 1 works from left-to-right. It is interpretted as p_grad = 1.1200e-17; ...

8 jours ago | 0

| accepted

Answered
converting and comparing 24hr cell to a minimum value
"Hoping to convert a string called "adjTIB" from a 24 hour cell ie. 14:11 " This is a bit ambiguous. Does the cell array conta...

9 jours ago | 1

| accepted

Answered
How can the ConstantLine LineWidth property default be set?
After looking more closely as your code, I realized you're using a property that doesn't exist "defaultConstantLineLineWidth"; n...

9 jours ago | 0

| accepted

Answered
How can I join points with line
Use matrix inputs. A line is drawn for each column of inputs. The first matrix defines the x values, the 2nd matrix defines th...

9 jours ago | 0

| accepted

Answered
Close a waitbar of a GUI from a function
The break command terminates execution of a while-loop or a for-loop. In nested loops, break exits only from the loop in which i...

9 jours ago | 1

| accepted

Answered
Loading a text file with strings and numbers
"The only number is “1.5”..." I see a 2 in there, too. "I need the code to store each item as a separate variable." That w...

9 jours ago | 0

Answered
How should I use the function Circfit ?
From the help section of that file, % x,y are column vector where (x(i),y(i)) is a measured point Their class are double. ...

9 jours ago | 1

| accepted

Answered
Rotate vector in row
Simpler n= [1,19,15,18,21,10,16,2,7,3,17,6,1; 1,14,20,8,4,13,9,5,1,0,0,0,0; 1,11,12,1,0,0,0,0,0,0,0,0,0]; % rand...

10 jours ago | 0

Answered
Speeding up a for loop
Idea 1 This single line does the same thing as the 2nd block of your code. Sum2 = sum(arrayfun(@(i)sum(C(i,:) .* (abs(A(i,:)...

10 jours ago | 0

Load more