Answered
Weighted average between NaNs with movmean, determing window length?
This approach breaks up the vector x into a cell array of non-nan segments and then calculates the mean of each segment. xMeans...

7 years ago | 0

Answered
How do I put vertical and horizonal error bars on a curve fit?
"I'm looking to have scattered points (with errorbars through them) on a plot with a line of best fit. I do not want all my poin...

7 years ago | 2

Answered
anyway to get list of linestyle in uiaxes of app
For an axis or uiaxis, the LineStyleOrder default value is '-' no matter what you've plotted unless that property was changed fo...

7 years ago | 0

| accepted

Answered
How can I work around the fact that app designer does not support output arguments?
"I have various functions that are GUIs that are called by other functions (or even other GUIs) and I need to be able to pass da...

7 years ago | 0

Answered
cut out section of x axis
This solution identifies all data with dates past 7/18 and shifts them down by 5 days. Then it overrides the x ticks with custom...

7 years ago | 0

| accepted

Answered
How to stop a plot window to open in app designer?
This line is opening a new plot; ax = gca; gca() returns the current axis but since the default HandleVisibility for uifigure...

7 years ago | 1

| accepted

Answered
Write cell array defined by a variable to a excel file
If you're using r2019a or later, use writecell() to write to an excel file. If you're using an earlier release, xlswrite(). Se...

7 years ago | 0

Answered
How can I solve this problem?
It looks like you're working with a GUI created in GUIDE. The GUI expects there to be a function named "popupmenu1_CreateFcn" b...

7 years ago | 1

Answered
How to create 2d plots
There are several major bottlenecks in your code that are slowing down the animation. on each iteration you are destroying t...

7 years ago | 2

Answered
I can't erase non-numerical data from an editable text
isstrprop() can be used to identify which characters are digits within a string. Then you can removed anything that isn't a dig...

7 years ago | 0

Answered
For many vectors of data of different length, how do I interpolate to set them all to have the same length?
Use interp1() Demo: xdata = 1:280; ydata = 10:150; xdataResamp = linspace(xdata(1),xdata(end),numel(ydata)); ydataInte...

7 years ago | 0

| accepted

Answered
Combine arrays of different dimensions
You cannot have a matrix with varying row lenght. One alternative is to create a padded array where NaN values fill the ends o...

7 years ago | 4

| accepted

Answered
Finding the common range between two ranges
This solution matches the outputs produced in Bruno's answer but is simpler and does not rely on external functions. % Create e...

7 years ago | 0

Answered
how can i move the object along a path?
"errors are occuring.could anyone help me to edit my code" The code you provided runs without errors. However, the animated ob...

7 years ago | 2

Answered
Tell me how isoutlier function works
The algorithm is explained in the documentation. "By default, an outlier is a value that is more than three scaled median absol...

7 years ago | 1

Answered
How to add box to an image?
Use the handle output from imshow to get the image's coordinates. The XData and YData properties will provide you with the coord...

7 years ago | 0

Answered
Using if else in a loop
This x < t <= x+y should be (x < t) && (t <= x+y) Here's a demo that shows why the first line fails. % This returns TRU...

7 years ago | 0

| accepted

Answered
My code has returning issues
Place semicolons (;) at the end of lines to supress the command window output. Lines that do not end with a semicolon may print...

7 years ago | 1

Answered
Existing Subplot Figure Adjustment
Create new axes to match a template You could treat N1_0D.fig as a template by opening the figure, clearing all of the axes and...

7 years ago | 0

| accepted

Answered
error: Unable to perform assignment because the left and right sides have a different number of elements.
In your for-loop, it looks like you're expecting pipeCost to produce 1 value per iteration. If that is the case, you're missin...

7 years ago | 1

Answered
How to solve: Error: Output argument "variable_name" (and maybe others) not assigned during call to "function_name" ?
If you set a break point just before your i-loop and step through the code, you'll notice that 1) the code never enters the i-lo...

7 years ago | 0

| accepted

Answered
How to enforce user to use the right letter
input() method One way is to continually ask the user for input until they get it right. This is done in a while loop. A regu...

7 years ago | 1

| accepted

Answered
Output name same as input names but with an extra word at the end to distinguish
If you're reading in a txt file and saving an excel file, you don't need to have different names but it still might be a good id...

7 years ago | 0

| accepted

Answered
how to get index of selected item in listbox of appdesginer
Continuing from comments under the question. There is unfortunately no property of a listbox that returns the index of the sele...

7 years ago | 3

| accepted

Answered
How to assign to the RowNames the sorted values of a table
"...''FitA4'... will [become]: FitA4=10.314." This is called dynamic variable naming and it's not a good strategy. You alread...

7 years ago | 0

| accepted

Answered
How to call a specific element of a table
Assuming your table is named "T", % find the rows where time equals 2 and perhexagon equals exactly 2.1667 rowidx = T.time == ...

7 years ago | 0

| accepted

Answered
store which iterations that the error took place
You could customize your own error message by basing it on the actual error message and appending the iteration number. for i ...

7 years ago | 0

| accepted

Answered
how show weights with different color
See comments h = plot(y,x); % There should be 1 handle per line object % choose the colormap (eg, jet) and number of levels ...

7 years ago | 0

| accepted

Answered
How do I split a sing column .txt file by line?
This solution is quite fast and uses fgetl() to read in blocks of a text file and saves those blocks to a new text file. You ca...

7 years ago | 0

Answered
Customizing location of plot on figure
Here's how to reduce the width of an heatmap to 50% and to center it on the figure. If you only want to reduce it to 50% and no...

7 years ago | 0

| accepted

Load more