Answered
Create a binary signal
This solution uses the square() funciton which converts a sin wave into a square wave with normalized values between [-1:1]. Al...

7 years ago | 0

| accepted

Answered
Combine multiple data series into a single series
Specify a vector of object handles in your call to legend. https://www.mathworks.com/help/matlab/ref/legend.html#bt6ef_q-1-su...

7 years ago | 0

| accepted

Answered
Extracting points from a plot that do not appear in the original data
Here's a demo % Order is important! % Line 1 is defined by the first two values. Line 2 is defined by second two values. x =...

7 years ago | 0

| accepted

Answered
Find peaks in a specific portion of data?
Option 1: set threshold If the outliers always have such an enormous amplitude relative to the signal, an easy approach would b...

7 years ago | 0

| accepted

Answered
Adding constraints to lsq fitting
"...I want to add some constraints at the boundaries... " In your call to lsqcurvefit(), you're not using the upper and lower b...

7 years ago | 2

Answered
Neural Network error please help me "Inputs and targets have different numbers"
P is size [3 x 6] while T is size [6 x 1]. You need to have one T value for each column of P. To fix this, transpose T so its ...

7 years ago | 2

| accepted

Answered
Transforming a right skewed data set to normal
Have you tried fitting the data to a Weibull distribution? Matlab's mblfit() reutrns the maximum likelihood estimates of the par...

7 years ago | 0

Answered
How can I plot the realizations of a Gaussian signal?
"I would like to plot the realizations of a simple Gaussian signal with mean 0 and unit variance. Let's call it X(t)." The para...

7 years ago | 0

| accepted

Answered
colormap plot adjust colors
There are several ways to do this. The colormap jet ranges from blue to green to yellow to red. This solution uses the jet col...

7 years ago | 1

| accepted

Answered
Color graph area in different shades
Yep, it's possible. Check out these examples using patch(). Your x and y values will be defined by the curve and the limits o...

7 years ago | 1

| accepted

Answered
Error in find command....
One equal sign assigns a value to a variable. Two equal signs perfoms a comparison between A and B and returns a logical value...

7 years ago | 0

Answered
How to keep different colors for stacked bars in a multiple plot?
You can apply color to the bar sections after plotting. yyaxis right bh = bar(x,y2,'stacked'); %save the handle! ...

7 years ago | 0

| accepted

Answered
how to perform xor of two bits in matab
Convert from char to logical matrices jbin = (j + '0') == 97; sbin = (sc_o + '0') == 97; Now your data are size [80 x 2] >...

7 years ago | 0

Answered
Datetime conversion to table headings
If your goal is to write to an excel file, why do you need to create a table? Instead, you can organize your data into a cell ar...

7 years ago | 0

| accepted

Answered
How to get an array of all field elements of a 1xN structure?
If the values stored in .end_dates are scalars, Test = [Results(:).end_dates]'; %Test will be column vector If the values s...

7 years ago | 5

| accepted

Answered
The best way to input a table with a unique format
(Continuing from comment section under the question) The best format for a table depends on how you plan on interacting with th...

7 years ago | 0

| accepted

Answered
Importing data from a txt file that is laid out in matrix form
Set the path to your text file and the number of columns in your text file. This will preserve the format of your data and store...

7 years ago | 1

| accepted

Answered
Figure Axis formatting; how to move label from axis
To change the position of the x label, store the handle to the xlabel, then change its position property. By default the axis l...

7 years ago | 7

| accepted

Answered
integers error in matlab
The 3 lines of code you presented are fine. My guess is that you're executing the 3rd line manually, perhaps from the command w...

7 years ago | 0

Answered
Extending Polyfit to Specified Y Value
After you compute the coefficients using polyfit(), you can use a different set of x values in polyval() to compute a new set of...

7 years ago | 0

Answered
How can I update my values in this loop?
The values are updating. It's just that the values are very very close to each other and the much-larger y axis range is flatte...

7 years ago | 1

| accepted

Answered
Check for subfolders in a folder
Parts that were wrong with your code paths are strings; yours did not have quotes fullfile() will put together paths from nes...

7 years ago | 0

| accepted

Answered
Excel Data into GUI table
Here's an idea. Load your data ahead of time and store it in the UserData property of your button. That can be done anywhere i...

7 years ago | 0

| accepted

Answered
Append vectors from different excel sheets into one vector
List the file names (and full paths, if possible) to all excel sheets in a cell array. Create a loop that will loop through ea...

7 years ago | 0

| accepted

Answered
Why do I keep getting this error?
My guess is that ylim produces a [1 by 2] vector but [t(t_startx), t(t_startx)] does not produce a [1 by 2] vector. If that's...

7 years ago | 0

Answered
Run many iterations of a code
Here's a template n = 1000; %number of iterations Team_1_Prediction = zeros(1,n); %here's where we...

7 years ago | 0

| accepted

Answered
App Designer serial runs
In general, always specify axis handles when plotting. This is especially important when creating plots from a GUI. The reason...

7 years ago | 0

| accepted

Answered
Getting velocity from acceleration using cumsum
Units of acceleration are typically m/s^2 (meters per second squared). Time is typically in seconds. So when you multiply (m/s...

7 years ago | 0

Answered
PROBLEM: How can I update only the changed variables in my saved workspace?
(continuing from the comments under the question) To save a specific list of variables to an existing mat file, list the variab...

7 years ago | 0

Answered
HOW TO CREATE A FOLDER WITH DIFFERENT NAMES AND A SUBFOLDER FOR EACH FOLDER
At the top, define the parent directory (the directory where your simulation data folders will go). Then set the number of simu...

7 years ago | 1

| accepted

Load more