Answered
Problem with hold on plot
The loop should only contain the data you're adding to the plot. Try this out. figure axes() hold on ylim([-18e-3,18e-3]) ...

6 years ago | 0

| accepted

Answered
How do I name the columns of my table by the names of row 1?
Check out the ReadVariableNames property; set it to true. https://www.mathworks.com/help/matlab/ref/readtable.html#namevaluepai...

6 years ago | 0

| accepted

Answered
How to count the number of 1 between two 0 in a vector?
In both methods below, A is the input vector (row or column) B is the output vector of consecutive 1 counts, row vector. M...

6 years ago | 1

| accepted

Answered
How to create GUI plot using the UIAxes, PlotType, and RunList box
You must specify the axis handle in all graphics functions when plotting to a UIAxes in AppDesigner. Assuming the app's axis ha...

6 years ago | 0

Answered
How to plot a graph on the app designer?
Use copyobj() to copy all of the children from your saved figure's axes to the UIAxes. Here's a functional demo. % Create a ...

6 years ago | 0

| accepted

Answered
how to sum data every year
No loop needed. Use findgroups() on the appropriate column(s) to group the rows. Then use mu = splitapply(@mean, data, grou...

6 years ago | 0

| accepted

Answered
How to make multiple boxplots in one axes?
Here are several ways to add boxplots to an axis at specific x coordinates. The first two methods involve padding the input arr...

6 years ago | 3

| accepted

Answered
generate a random path between two points
Because I like random walks (example1, example2), I altered an existing code I have to (kind of) do what you're describing. Howe...

6 years ago | 1

Answered
How to remove the Range from colorbar in HeatMap
Heatmaps are notoriously difficult to customize outside of the HeatmapChart Properties. The only property that I'm aware of tha...

6 years ago | 0

| accepted

Answered
[DISCONTINUED] MATLAB Answers Wish-list #5 (and bug reports)
Spell check for questions / answers / comments A spell check option would improve the quality of content, reduce misunderstandi...

6 years ago | 9

Answered
How do I show a line being created (like an animation) between two points inside a plot?
If needed, interpolate your data to get more or less data points. Here's an example xvalues = 1:16; yvalues = (1:16).^2; n...

6 years ago | 2

| accepted

Answered
How to combine arrays in a cell from 71 x 12 to 1 x 71?
% Loop through the rows of Cmo and combine them % back into 1 table. Then sort the rows so that % they are in chronological ...

6 years ago | 1

| accepted

Answered
Adding two node labels to graph
There are lots of ways to do this. Here's a simple approach that uses labelpoints from the file exchange instead of labeling th...

6 years ago | 0

| accepted

Answered
Dicom file in app designer
You just need to specify the UIAxis handle in your app. Here's a functional demo using a built-in dcm file. info = dicominfo(...

6 years ago | 0

| accepted

Answered
How to have a loop-for to filling NaN rows?
The best approach would be to do this within the j-loop from this answer (you just need to change 1 line and add 3 lines). The ...

6 years ago | 1

| accepted

Answered
How to get point value in app designer plots?
Provide the app's figure handle in your call to datacursormode. The window DisplayStyle is not supported in UIfigures. The d...

6 years ago | 1

| accepted

Answered
How can I update the x axis limit inside a loop?
On the first iteration, om is all 0s so [om(1) om(end)] returns [0,0] which, as you pointed out, is not allowed when setting axi...

6 years ago | 0

| accepted

Answered
Find the values before an element repeated more than 4 times.
Input: A, numeric row vector Output: valueBefore, a numeric vector of values prior to 4 or more consecutive 0s. A=[ 1 2 3 ...

6 years ago | 1

| accepted

Answered
Is it possible to use the for-loop for this purpose?
Using the cell approach where Cmo is a nx12 cell array of n station-tables for 12 months. stationList is read in as a table. T...

6 years ago | 1

| accepted

Answered
How do I write a function to convert numerical month of the year to the name of that month?
Another method to return month names given month numbers using datetime and month, monthNames = month(datetime(1, 1:6, 1), 's')...

6 years ago | 2

Answered
Problems with averages and storing values
Advice & hints Smart-indent your code for better readability (I already applied correct indentation to the code in your questio...

6 years ago | 0

Answered
creating circles for multiple points with viscircle
To plot a set of circles defined by their center points and a radius, you can use the the rectangel function with 100% curvature...

6 years ago | 0

Answered
Problem with obtain regression equation between 2 data sets
Polyfit is probably what you're looking for. From the documentation, "If either x or y contain NaN values and n < length(x), th...

6 years ago | 1

| accepted

Answered
How to get answers to appear as an array?
It looks like your outputs are being produced within a loop. Instead of displaying their values within the loop, collect the va...

6 years ago | 0

Answered
How do you randomly choose a grey bar in picture to turn white?
For grayscale images, imwrite() assumes that the dynamic range of the first input is [0,1] and automatically scales the data by ...

6 years ago | 2

| accepted

Answered
How to write a loop for this case?
The variable "C" is a 1xn cell array where each element contains a table. Each table contains a column "date" listing dates in ...

6 years ago | 1

| accepted

Answered
R2019b tiled layout
"the colorbar looks strange" I assume you mean that the colorbar size doesn't scale with the axis size after applying axis imag...

6 years ago | 0

| accepted

Answered
How can I find an uifigure?
You can find the uifigure handle using findall() but it's not recommended to merely find handles to all figures because it's qui...

6 years ago | 1

| accepted

Submitted


labelpoints
Automatically label points in your plot given x and y values & an array of labels.

6 years ago | 12 downloads |

4.9 / 5
Thumbnail

Answered
hyperlink and center alignment in msgbox
If you are using App Designer or creating apps with the uifigure function, then use uialert instead of msgbox. However, neith...

6 years ago | 0

| accepted

Load more