Answered
Deleted first repeated elements of an array
Here's a demo. The first section just creates demo inputs. The second section solves your question. The third section just con...

6 years ago | 1

| accepted

Answered
add more tick labels to a datenum graph
Adjust xtick axis property. This method below specifies 6 ticks that start and end at your existing tick bounds ax = gca(); ...

6 years ago | 0

| accepted

Answered
Problem with "dirty" GUI configuration
These are the kinds of errors that happen when a GUI figure is edited from within GUIDE while the m-file is paused in debug mode...

6 years ago | 0

| accepted

Answered
extrapolation from correlated data
Hint: If you're data are linear, the regression slope is the covariance between X and Y divided by the variance of X m = cov(...

6 years ago | 0

| accepted

Answered
How can i keep my variables after running the function?
" Is it possible to keep the variables once a function has run " Yes. Add outputs to your function if variables are immediate...

6 years ago | 2

| accepted

Answered
Plotting cell of different sized vectors
You could use arrayfun() Here's a demo. C is the cell array containing vectors, h is the handles to each line object. C = {[...

6 years ago | 1

Answered
How to stackedplot with text data
** UPDATE** Almost a year later I learned of a way to add text to stackedplot axes. See this answer: https://www.mathworks.co...

6 years ago | 1

| accepted

Answered
error in color/linetype argument
The list of color characters can either be a cell array of characters or a string array. Your current definition of col is a si...

6 years ago | 0

Answered
Generating Random Numbers with known probability and more
" I know I need to create a line of code that allows me to pick either 0 or 1 to represent sweet and sour ... but there is a pre...

6 years ago | 0

Answered
change color of an object
Here are the steps taken in the code below. There may be a better approach but this should get you started. See inline comment...

6 years ago | 2

| accepted

Answered
Creating a matrix of random numbers which their distributions are stored in a table?
It would be better to construct the DistFit table so that the function and the input values are in separate columns. That way y...

6 years ago | 0

Answered
how to make a perfect table
The idea is to convert your cell arrays to tall matrices or column vectors. That could be done prior to entering the values int...

6 years ago | 0

| accepted

Answered
how to plot a cute sphere
If you don't have access to the cuteSphere toolbox, you can just use this line of code below to make the sphere appear as a sphe...

6 years ago | 2

| accepted

Answered
How to set a global random seed in a GUI?
You're on the right track. Choose a random seed when the GUI initializes and store it in your GUI using guidata() so all compon...

6 years ago | 0

| accepted

Answered
split numbers separated by commas in a sub cell array into their own column
You were on the right track with cell2mat but first you have to pad the arrays so they are all equal length. Two of the three l...

6 years ago | 1

| accepted

Answered
Greetings, Anyway to help to create ridgeline by MATLAB
Here's a demo that creates a number of guassian distributions as input. The code produces an appropriate number of contiguous s...

6 years ago | 1

| accepted

Answered
How can I change zeros matrix to 1 by specific points??
Here's a demo. When [x0,y0] is [4,3] and [x1,y1] is [6,7], a rectangle of 1 will be placed in matrix A in rows 3:7 from the to...

6 years ago | 0

| accepted

Answered
change scale for colorbar
You can set the color range of each subplot to be equal and then add a colorbar only to one of the plots. Then change the color...

6 years ago | 0

Answered
Plot continuous line based on user input
"How would I plot a line with a slope of one that goes infinitely until it hits the y axis" I'm interpreting this as a line tha...

6 years ago | 0

| accepted

Answered
Reorder x-axis bar graph categorical
Starting in MATLAB R2023b, bar accepts string arrays in addition to categoricals in the x-argument. The bar order will maintain...

6 years ago | 3

| accepted

Answered
List of All Timezones
Somewhere in your code timezones is being called. Search all of your files for the word timezones to find which file is printin...

6 years ago | 0

Answered
Detecting Entire Column has the same integer value
To determine which columns contain identical values, A=[1 1; 1 0.5; 1 0.5]; B = all(diff(A,[],1) == 0,1) %...

6 years ago | 0

Answered
Rotate ylabel with yyaxis left keep centered and space between yticks
Starting in MATLAB R2023a when you change the Rotation property of an axis label in a 2-D plot, the HorizontalAlignment and the ...

6 years ago | 2

| accepted

Answered
Plotting external function in App GUI graph
Pass the axis handle into your testgraph() function so your external plotting function knows what axes to plot on. It would lo...

6 years ago | 2

| accepted

Answered
Is it possible to remove labels added with labelnode?
Here's how to remove all labels and how to restore default labels % Create demo GraphPlot s = [1 1 2 2 3 4 5 5]; t = [2 3 3 4...

6 years ago | 0

| accepted

Answered
How to write a script that will call for user input to lead a file
Using matlab's [file,path] = uigetfile is much more constrained than relying on the user to type in an existing file name. That ...

6 years ago | 0

Answered
how to remove zeros from the matrix?
This approach extracts the first two non-zero elements per row. If there are no two non-zero elements in each row an error is t...

6 years ago | 1

Answered
How to loop identical numbers and find row numbers
This finds all rows of A that are repeated at least two times and the labels them with a 1 in an appended third column. A= [ 1...

6 years ago | 0

| accepted

Answered
How can I convert a figure into a uifigure?
You can use copyobj() to copy the content on the external axis on to your UIAxis. This will not copy axis labels, titile, or le...

6 years ago | 2

| accepted

Answered
Zoom and polar axes
The zoom() feauture seems to be disabled on polaraxes. You could use set rlim() and thetalim() to zoom into a specific area. ...

6 years ago | 0

| accepted

Load more