Answered
How can my function work?
In addition to what the others have stated, since you're using & in your if conditions I'm guessing you're passing a vector, mat...

7 years ago | 0

Answered
ODE triggered event does not stop
Your event function shouldn't use the relational operators itself. The only possible values your events can take on are 0 and 1 ...

7 years ago | 0

Answered
finding special date time
Find the next Sunday after a given date. T = datetime('today'); nextSun = dateshift(T, 'dayofweek', 'Sunday', 'next') All Sun...

7 years ago | 0

| accepted

Answered
Can anyone tell me the error with sum function?
Based on prior experience, I suspect you received the error "Array indices must be positive integers or logical values." If that...

7 years ago | 0

Answered
How to keep the precision of datetime when taking into consideration time offsets
You don't actually want a datetime array, you want a duration array. That's easy. First remove the fractional seconds. There's n...

7 years ago | 2

| accepted

Answered
Call function multiple times but execute once
I think it unlikely that ga is calling your function with exactly, down to the last bit, the same inputs multiple times. It's li...

7 years ago | 1

Answered
Out of memory (infinite recursion) running a stochastic collocation
[mean, stdev] = Stochastic_Collocation(x,nomforce); You call your function inside itself, which causes your function to cal...

7 years ago | 1

| accepted

Answered
Issue with atan2(.)
The atan2 function included in MATLAB requires exactly two input arguments. Therefore you're likely calling a different atan2.m ...

7 years ago | 0

Answered
Pre-allocating memory for a while loop
I'm running a code that is based on a while loop to similate a chemical process. It simulates an added amount of species each se...

7 years ago | 0

Answered
Is there any option to use boxlabelDatastore function in Matlab 2017b?
This function was introduced in Computer Vision Toolbox in release R2019b according to the note at the end of its documentation ...

7 years ago | 0

| accepted

Answered
Wrong left and right assignment error
for n= 1:1:100 l(n) = n.*(a.*b.*c); When you execute that second line of code, n is a scalar (size 1-by-1.) The variables ...

7 years ago | 0

Answered
wlan toolbox is incompleted
There's a note at the end of the documentation page that states this function was introduced in release R2019a. If you're using ...

7 years ago | 0

Answered
Using now() in different time zones (or with daylight saving time)
If you want control over the time zone, you probably want to use datetime instead of now. N1 = datetime('now', 'TimeZone', 'loc...

7 years ago | 0

| accepted

Answered
How to override inherited methods?
You can't do what you asked. If you could, you could relax the property setting validation to the point where your subClass inst...

7 years ago | 0

| accepted

Answered
Why is format long providing a strange result?
I recommend using format longg instead of format long for this case.

7 years ago | 1

Answered
Set properties of child objects without synchronisation errors
Let's take a step back from the code for a second. Can you describe the design of your system for which this set of classes will...

7 years ago | 1

Answered
How to require a custom class type with addRequired?
You probably want to use addParameter instead of addRequired. If you're using release R2019b or later, consider using function ...

7 years ago | 0

| accepted

Answered
Replacing <undefined> in categoricals or defining a default value
You could fillmissing to fill in the <undefined> entries, but if you want to leave them as missing data for future processing yo...

7 years ago | 0

Answered
How would I use Voronoi and/or Delaunay Triangulation methods for information on polygons
Why not just create a polyshape or an array of polyshape objects on which to operate? The NumRegions property gives you the numb...

7 years ago | 0

Answered
How to solve a ODE that is a function of a cubic polynomial f(x) = 0?
This doesn't look like a system of ODEs. The presence of the variable d in the first set of curly braces threw me for a second, ...

7 years ago | 0

Answered
Why is my for loop getting faster and faster?
This doesn't strike me as a bug. I suspect this is due to the execution engine introduced in release R2015b (which uses just-in-...

7 years ago | 0

| accepted

Answered
cannot modify plot axes as per documentation
Can you post the exact URL for the documentation page that says you can change the plot units by right-clicking, so we can see e...

7 years ago | 1

Answered
LDU factorization matrices help.
Use the ldl function.

7 years ago | 0

Answered
Find the data same week day one year ago.
You want the date exactly 52 calendar weeks ago? datetime('today')-calweeks(52)

7 years ago | 0

| accepted

Answered
Derivative using datenum format vector
Use the minutes function to compute the difference between two elements of a datetime array (or two datetime arrays) in terms of...

7 years ago | 0

| accepted

Answered
ode45 for 4 DOF system - How to do with Matrices?
Is there a reason you're computing the inverse of the mass matrix and performing that multiplication instead of using odeset to ...

7 years ago | 0

Answered
simulering.m Line: 17 Column: 7 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
for v_(size(t))=v_(size(t)-1)+f*i*F_red-Q_ud; That's not valid MATLAB syntax. It looks like you may be trying to create variabl...

7 years ago | 0

Answered
Compare nearby elements in array
I think the islocalmax function, specifying both the dimension over which to operate and a 'ProminenceWindow', will do what you ...

7 years ago | 0

Answered
Decision Branching Error in matlab onramp
That might be checking that the densities that are printed as text when doPlot is 0 exactly match the densities that would be pr...

7 years ago | 2

| accepted

Answered
Solving Linear System of Equations with a Real Parameter
What do you know and what are you trying to find? Do you know the value of and you're trying to find the X values? If so, build...

7 years ago | 0

Load more