Answered
Boxplot x-axis not numerically ordered
See the GroupOrder property of boxplots.

8 years ago | 0

Answered
How to create a graph from a matrix showing its values.
This example should help to get you started. Let me know how I can help further. You'll use contour() to draw the contour line...

8 years ago | 1

| accepted

Answered
Filtering data based index from a cell.
Your variable "max_sin_value_part1" is a [40x1] cell array. Each element contains a [1x1] cell array and that cell array contai...

8 years ago | 0

| accepted

Answered
Plotting in a for loop
On the first iteration of the loop, the "hold on" command isn't called until after the first plot() object is overwritten. To f...

8 years ago | 0

| accepted

Answered
Finding the 7-day minimum of a time series
For matlab versions 2016a or later, see Steven Lord's solution. There's more than one way to define a 'consecutive minimum'...

8 years ago | 0

Answered
Why my subplot command skipping the first graph's title and labels?
You're calling title(), xlabel() and ylabel() prior to calling subplot() so instead of applying these functions to the new subpo...

8 years ago | 1

| accepted

Answered
Guide components missing due to y position > 1
This solution is based on Rik Wisselink's suggestion in the comments under the quesiton. The idea is to find objects within th...

8 years ago | 0

| accepted

Answered
Vectors must be the same length error
After understanding the purpose of the code in the comments under the question, I rewrote the code to produce a plot that was de...

8 years ago | 1

| accepted

Answered
How to add 0 values before and after a sine wave ?
It's not exactly clear what you're asking for but here are two solutions. If you just want to add 10 points to the beginning a...

8 years ago | 0

| accepted

Answered
find a particular string from struct cell array
Try this idx = strfind(s1,s2); part1 = s1(1:idx-1); part2 = s2(idx+1:end);

8 years ago | 0

Answered
I have a file name 'partOneData.mat how do I load the data and create a histogram from Matlab.
First read about the output to the load() funciton: https://www.mathworks.com/help/matlab/ref/load.html#btm0etn-4 The output ...

8 years ago | 0

| accepted

Answered
Problem by drawing a line on axes
There are two errors. First, you're getting a diagonal line because the first input of line() contains all x-values but you're...

8 years ago | 0

| accepted

Answered
What is 'categorical predictor' in decision tree for regression
Matlab's fitrtree() function returns a regression tree object. Read more about this object and its properties here: https://w...

8 years ago | 0

| accepted

Answered
Replacing values in vector segments with highest value
This solution takes an input vector 'v' and differentiates the indices of non-zero values in order to measure the distance betwe...

8 years ago | 0

| accepted

Answered
Plot3 with different length of vectors
You need to specify the x (SNR) and y (Weight) coordinate for each z-value (error). Since z is a matrix, x and y need to be mat...

8 years ago | 1

| accepted

Answered
Specifying both marker type and marker size in a 'scatter' call
Check out the 3rd input to scatter() https://www.mathworks.com/help/matlab/ref/scatter.html If you're changing the size after ...

8 years ago | 1

| accepted

Answered
How can I change axis spacing in partial dependence plots
This is not tested but to get the percentiles you listed, x_ax = prctile(X(:,1),10:10:100) and use those percentiles as x-tic...

8 years ago | 0

| accepted

Answered
How to call and run one .m file in another .m file at specific place?
If your m-file is a function, go to the line of code where you'd like to call the function and call it like this (in this exampl...

8 years ago | 2

Answered
How I can plot 2D figure (x,y) and add 3rd axis (velocity) by variation the color through the path?
This solution uses scatter() to add color to each marker based on the values in 'v'. At the beginning I create random fake dat...

8 years ago | 0

Answered
How to change a section of the background color of plot?
For datetime axes, you can use datenum() and datetick() as in the example below. This allows you to apply a patch object to the...

8 years ago | 2

Answered
how can i connect all the points together with a continuous line at the following matlab code
The while-loop should probably be replaced by a for-loop. In any case, if you keep the while-loop you just need to store the ...

8 years ago | 0

Answered
delete row by clicking UITABLE
The UserData does not contain the index of the cell selection. To get the index of your cell selection you need to use the 2nd ...

8 years ago | 1

| accepted

Answered
Global variables. How to write global variables?
Sounds like a wild assignment. Anyway, here's an example. global x %declare global var x = 5; ...

8 years ago | 0

Answered
How to update Subplots in GUI
Presumably your axes are created from within the GUI. Are you using GUIDE or are you building the GUI from scratch? In any cas...

8 years ago | 0

Answered
What is the standard way to create a dependency graph in R2018a?
depfun() listed the paths of all files a specific m-file (or p-file) needed to function. It didn't produce a graph, unless you'...

8 years ago | 1

Answered
How to color a matrix based on the values in matlab?
heatmap(A) xlabel('column number') ylabel('row number')

8 years ago | 3

| accepted

Answered
Problems with plotting multiple objects
I assume you're talking about the gray rectangle created by this line: rectangle('position',[x(6),y(4),d,3*d],'FaceColor',[0.5...

8 years ago | 0

Answered
Comparing two input voltages?
"if signal 1 is 3v then signal 2 should be ~1.5v before then passing signal 1 forwards to operate a servo." If signal 1 is an i...

8 years ago | 0

Answered
how to have a line marking in 3d image?
Start here: plot3() https://www.mathworks.com/help/matlab/ref/plot3.html

8 years ago | 0

Answered
how could i animate a series as an animation ?
Here's a demo below. First create the data, set up the figure, then loop through each coordinate to plot the next line segment (...

8 years ago | 1

| accepted

Load more