Answered
How do I continuously update a figure axis with time values using animatedline?
The problem with this code is that the x-axis only shows the most recently collected timestamp. That is the correct behavior as...

3 years ago | 0

Answered
Error using fit: Index in position 1 is invalid. Array indices must be positive integers or logical values.
I'm guessing you've created a variable named fit that's preventing MATLAB from calling the fit function. You can check this usin...

3 years ago | 0

| accepted

Answered
Simscape Multibody Link download
Are you trying to follow the steps given on this documentation page? If so, at which step or sub-step are you experiencing diffi...

3 years ago | 0

Answered
Understanding how testCase.addTeardown works with @path
From the addpath documentation: "oldpath = addpath(___) additionally returns the path prior to adding the specified folders." So...

3 years ago | 1

| accepted

Answered
Count the number of guesses made by player
Define a variable that records how many guesses the player has made. Each time the player makes a guess, add 1 to that variable...

3 years ago | 1

| accepted

Answered
problem in neighbors function
The neighbors function, in this context, requires its first input to be a graph object not an adjacency matrix. Create a graph o...

3 years ago | 0

Answered
error in table2array - unable toconcatenate the specified table of arrays
You cannot turn this table into an array with table2array. Luckily, you don't need to turn it into an array. The reason you can...

3 years ago | 0

Answered
Class constructor that can create either a single object or an object array depending on number of the argument
Your constructor needs to accept the case where it is called with 0 input arguments. See the section "No Input Argument Construc...

3 years ago | 0

| accepted

Answered
Generate Random Number, that is that is repeatable
So you want to replace a certain section of your P_MMSI vector with the same random number? Let's look at your original code: %...

3 years ago | 0

| accepted

Answered
MATLAB Simulink Model Recovery
Check if any of the Bug Reports related to crashing in the Simulink product in release R2021a seem relevant. If not, please use ...

3 years ago | 0

Answered
How to continue performing this flowchart about Gauss - Jordan method in a matlab code?
That check basically says to skip the first iteration of the loop. You could do this with an if statement and a continue stateme...

3 years ago | 0

Answered
Update doesn't work, is uninstall and reinstall too risky?
Update does not work, "I have no rights to write" to the drive/directory. Did you install MATLAB originally or did someone in y...

3 years ago | 0

Answered
Using to the 'fill' function to plot a filled polygon that are confidence intervals
Let's draw the region "around" a simpler line. x = 1:10; y = x; plot(x, y, 'k', 'DisplayName', 'Original Line'); legend show...

3 years ago | 0

Answered
How to code "e" by itself in equation e-1?
@Torsten and @Matt J are correct to suggest the exp function, but if the quantity x/a can be very small you might also want to l...

3 years ago | 1

Answered
Previous matrix numbers in the formula and creating a new matrix
The arithmetic operators plus, +, minus, -, times, .*, ldivide, .\, rdivide, ./, and power, .^ operate element-wise. x = 1:5 y...

3 years ago | 0

| accepted

Answered
How can I change the variable x0 to x2,x3,x4,...xn . So it still produces the same pattern?
Can you dynamically create variables with numbered names like x1, x2, x3, etc.? Yes. Should you do this? The general consensus ...

3 years ago | 0

Answered
I attached an old Matlab man page from 1982.
I haven't looked at that document but since that was prior to the incorporation of MathWorks in 1984, I'm guessing that's a vers...

3 years ago | 0

| accepted

Answered
Improve efficiency of for and if loops
I'm not 100% certain but based on the description I think either ismembertol or histcounts2 (specifically the 4th and 5th output...

3 years ago | 0

Answered
Matlab Unit test framework, general questions about the structure
Taking each question in turn: Documentation how I can understand what part of the online documentation is valid for my current...

3 years ago | 0

| accepted

Answered
I'm trying to convert a 1 dimension lat,lon,data to 2d data . Is this possible?
My aim is to regrid the data from original resolution to a desired resolution (ex. 2.5x2.5 degree) and count the number of data ...

3 years ago | 1

Answered
Print matrices whose name is based on loop values
Can you dynamically create variables with numbered names like k1, k2, k3, etc.? Yes. Should you do this? The general consensus ...

3 years ago | 2

| accepted

Answered
Take values greater than 0 excluding NaN
A = [NaN NaN 1; NaN -2 -3; NaN NaN NaN; 2 NaN -3; NaN -3 -3; 1 -1 0] % Adding an explicit 0 B = A; B(B <= 0) = 0; B(B > ...

3 years ago | 0

| accepted

Answered
n E Z => sin(n*pi) = -1 ?
Use the sinpi function. n = 100000000000000000000000000000; sinpi(n)

3 years ago | 2

Answered
Remove duplicate edges of undirected graph
Call simplify on your multigraph (you can tell if your graph or digraph is a multigraph using ismultigraph) to convert it to a s...

3 years ago | 0

| accepted

Answered
Plotting a multidimensional array (or a 3D matrix)
What type of plot do you want to create? Look at the thumbnails in the Plots Catalog (the Plots tab of the Toolstrip) and see on...

3 years ago | 0

Answered
Remove nodes in a graph based on label name instead of index
B = graph(bucky, string(1:60)); % Use '1' through '60' as names head(B.Nodes) % Show the first few node names B2 = rmnode(B, '...

3 years ago | 1

| accepted

Answered
undefined function error for builtin toolbox function
If this recurs in the future, you don't need to reinstall. Likely you had a directory on your MATLAB path that contains an imple...

3 years ago | 0

Answered
2D-Histogram with log y and x ticks
Instead of using hist3 I recommend you use histogram2. edges=2.^(-8:0) % Set the lower limit to be whatever will cover your dat...

3 years ago | 0

| accepted

Answered
Reading numbers from String
Yet another approach: str = {'SRm40_','SRp5_'}; str = replace(str, 'm', '-'); % Handle negative numbers str = replace(str, 'p...

3 years ago | 0

Answered
Create Categorical array for histogram on R2020a
I tried running those three lines of code in release R2020a and it produced the categorical histogram plot that I expected. Wha...

3 years ago | 0

Load more