Answered
Issue with finding the indices of the minimum element in a 3-Dimensional Array
Use the 'all' dimension argument and the 'linear' index argument to obtain the linear index of the maximum of the array consider...

3 years ago | 1

Answered
I don't understand the behavior of discretize
The calculated edges make no sense, and the output is clearly bins of non-uniform width. No, in that example the bins are unifo...

3 years ago | 0

Answered
How to get user homepath?
Does getenv do what you want?

3 years ago | 0

| accepted

Answered
function in a script file
You cannot define a function inside an if statement. You can define a function in a script or function file outside of the if s...

3 years ago | 0

Answered
Creating funcing in spesific formats
Take a look at the format function.

3 years ago | 0

Answered
Where is plotSlice?
How are you calling plotSlice? According to the documentation page plotSlice requires its input to be a "Linear regression model...

3 years ago | 0

| accepted

Answered
How to write an quadratic.m function
I assume you've saved this in a file named QuadraticEquation.m. If so you just need to rename the file to quadratic.m and ideall...

3 years ago | 0

Answered
Remote matlab running: changing folder and running script
Instead of piping the contents of the file to MATLAB, use the -batch or -r startup options in conjunction with the -sd startup o...

3 years ago | 0

| accepted

Answered
Renaming .mat file
Use the movefile function.

3 years ago | 1

| accepted

Answered
GA - objective and constraints have to run the same expensive function
One potential solution would be to memoize your expensive function, pass the memoized function into your objective and constrain...

3 years ago | 0

Answered
Plotting 2D contours syntax
I am mainly concenred with having the "dot" after the variable. The dot is not associated with the variable, it's associated wi...

3 years ago | 0

| accepted

Answered
Deterministic SEIR ODE model running slow
The first thing I'd probably try is to use a stiff ODE solver instead of the nonstiff ODE solver ode45.

3 years ago | 0

Answered
How do I bin my X and Y data to plot the mean and SD?
X=[1 2 2 3 4 4 4 2 1 3]; Y=[0.1 0.3 0.31 0.36 0.5 6 6 0.32 0.11 0.38]; row = 1:numel(Y); accumarray([row(:), X(:)], Y)

3 years ago | 0

Answered
I have issues using datenum function because of a different date format on excel, how can I modify my dates in matlab and then run the function?n
Don't use serial date numbers and datenum. Use datetime instead. s = "12:34:56, 30 08 2022" fmt = "HH:mm:SS, dd MM yyyy"; dt ...

3 years ago | 1

| accepted

Answered
Date time conversion fail
I would like to conver a time to num format so i can do some basic math on it What math do you want to do to the time data? Th...

3 years ago | 0

Answered
Animated line and moving markers with different, changing colors
I advise you not to use handle as a variable name, as it already has a meaning in MATLAB. When you call scatter, since you didn...

3 years ago | 1

| accepted

Answered
where can I get the supporting file "helperViewDirectionAndDepth.m" for Monocular Visual Simultaneous Localization and Mapping?
If you have a sufficiently recent release of Computer Vision Toolbox installed, click the Copy Command button on that example pa...

3 years ago | 1

Answered
matrix operation to scalar
Don't overwrite your vector variable with a scalar value then attempt to use it as though it were still a vector. If you have a...

3 years ago | 0

| accepted

Answered
OOP: objects as properties of objects; objects with no methods; objects with no properties?
Is it OK to store other objects as properties of an object? Yes, but you will need to be careful in certain situations (most no...

3 years ago | 0

Answered
Extract subgraph using names
I'd use a string array, both when naming the nodes initially and when extracting the subgraph. B = bucky; n = height(B); G = ...

3 years ago | 0

| accepted

Answered
Cleaning string and reaction time data
I suspect that the standardizeMissing and/or fillmissing functions will be of interest to you.

3 years ago | 0

| accepted

Answered
svd(X,"econ") does not work as expected if X is square nxn matrix with rank<n
If you want a number of singular values fewer than the maximum number, consider using svds. Though for a tiny problem like this ...

3 years ago | 0

| accepted

Answered
can we plot convergence of a ode solver same as fsolve?
I think what you may be looking for is the OutputFcn. See the entry in the Name-Value Arguments section on the odeset function d...

3 years ago | 0

| accepted

Answered
Can I make addpoints function show me more than one curve in ONE figure ?
So you want multiple animated lines in the same figure? That's easy, just use multiple animatedline objects. x = 0:360; axis([...

3 years ago | 1

| accepted

Answered
second expression and second statement doesn't excuted in else if ?
In an if / elseif / else statement like this: %{ if condition 1 do some calculation 1 elseif condition 2 do some ca...

3 years ago | 0

| accepted

Answered
Displaying exponential notation with num2str?
Another function that might be of interest to you is formattedDisplayText, if you want to capture how the variable would be disp...

3 years ago | 0

Answered
"find" yields different results for linear vs 2D indexing
You don't need to use find. You don't care where the elements that satisfy your criteria are located, all you care about is that...

3 years ago | 1

| accepted

Answered
Calling a Function specific from a ToolBox
The function you indicated you wanted to call is only called in the event that the first input argument is either "a SeriesNetwo...

3 years ago | 0

| accepted

Answered
how to insert same scalar as length of something?
If you want to replicate the scalar in B to be the same size as A, you can use repmat. If you know that B will always be 0, inst...

3 years ago | 0

| accepted

Answered
I got the error of incorrect argument data type or missing argument in call to function 'gamma'.
The gamma function in MATLAB requires its input to be a floating-point number, specifically the input must be "Data Types: singl...

3 years ago | 0

Load more