Answered
Why does argmin index of NaN array have a value of 1 and not NaN?
If the second output from min in the case where the input is all NaN values were NaN, every single call to min that wanted to us...

2 years ago | 0

Answered
How Can I Calculate Displacement Of An Object (it can be a point on object) Out Of A Video Record
So you want to track an object through the video? I believe several of the examples found by this search may be relevant, partic...

2 years ago | 0

Answered
what does A/b mean when solving matrix Ax=b
The \ operator (mldivide function) solves for x in A*x = b. The / operator (mrdivide function) solves for x in x*A = b.

2 years ago | 1

Answered
How to find leaves in minimal spanning tree
It has been a while since this question was asked, and this answer wouldn't have worked at the time it was first asked, but you ...

2 years ago | 0

Answered
Access property of class object found by "whos"
So when you use an instance of this class, you want that instance to check if it was last updated too long ago? Why not just sto...

2 years ago | 0

Answered
Unit/integration tests that involve closing/re-opening handles to objects
What you're describing sounds like you could easily fall into Interacting Tests, a category of Erratic Tests. If you had some w...

2 years ago | 1

Answered
Loading variables to a specifc workspace
How can i use the load command to load variables to a specific workspace In general, you cannot do exactly what you asked. Ther...

2 years ago | 0

Answered
Clustering Calibration Data for Calculations in a Matrix
I'd just use the groupsummary function.

2 years ago | 0

Answered
Draw the surface of a two variables function
Let's look at the values your function takes on at the corners and the center of the region you're plotting. format longg Z = ...

2 years ago | 0

Answered
Automatically adjust bin width
Rather than trying to implement the binning operation yourself, I recommend you call the histcounts function in a looping constr...

2 years ago | 1

Answered
How easy is it to give a Matlab toolbox as a Christmas present?
I'm not certain if gift vouchers are available. I recommend you contact the Sales department directly using this link to ask thi...

2 years ago | 0

Answered
how can i get matlab code for this paper
If you have a specific question about where you're having difficulty implementing the code for this paper, show us the code you'...

2 years ago | 0

Answered
How do I index a variable based on the outcome of a logical expression (e.g if x +y = 2 then variable 2 is indexed)
Here's an example with one die. You can imagine how much more code than this you'd have to use if you wanted to count the freque...

2 years ago | 0

Answered
Why is the preprocessor check #if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) ) being generated in private.h?
From the Wikipedia page for C data types: "The minimum size for char is 8 bits, the minimum size for short and int is 16 bits, ...

2 years ago | 0

Answered
Error using linprog (line 369)
Please send your code and data to Technical Support directly using this link so the development staff can determine the cause of...

2 years ago | 0

Answered
Incorrect number or types of inputs or outputs for custom function.
Rather than making a 0-by-0 intL array and then immediately expanding it to be (potentially much) larger, why not start off assi...

2 years ago | 0

Answered
Path(pathdef) Error
Does your Run_Script script file define a variable named path on line 1, right before it tries to call the path function on line...

2 years ago | 1

Answered
How to Add Title to Legend ?
You're using a release of MATLAB that's more than ten years old. MATLAB has changed quite a bit during that decade, including a ...

2 years ago | 0

Answered
Function works fine in MATLAB, however, when I get to MATLAB coder, it fails with error does not terminate due to an infinite loop
Rather than checking if s is a char vector or has positive length, if you want to stop when the file has been read in I'd use fe...

2 years ago | 0

| accepted

Answered
Adding zeros to a column vector to match a larger column vector
If you're using release R2023b or later, you could use the paddata function. Let's create some sample data: % I have x where th...

2 years ago | 0

Answered
Creating a VAT Calculator in MATLAB
Is there a specific reason you're trying to create the app as a script file yourself? I'd consider using App Designer. If you ha...

2 years ago | 0

Answered
For loop problem for matrix
There are two values which are changing VGPL_xi and values that depend on K and VGPL_xi. Ah. So you're trying to figure out how...

2 years ago | 0

Answered
How to add zeros to the end of an array
If you're using release R2023b or later, you could use paddata or resize to do this. A=[ 1 5 3 8 9 4 7 6 5 2 ]; B=[ 5 2 3 9 7 ...

2 years ago | 0

Answered
Why am I getting a red message when trying to run this code.
In the future, please don't post a picture of your code, post your code itself (formatted using the first button of the Code sec...

2 years ago | 0

Answered
Issue with delete(obj)
Rather than creating and deleting a scatter plot over and over again, I think either using the comet function (if you have all t...

2 years ago | 0

Answered
Direct calculations on tables - elementwise mean of n-tables
Is there a simpler way? Yes. If you know that your data cell array is not empty, just use a for loop. n = numel(data); if n >...

2 years ago | 0

Answered
MCC/deploytool and excluded class
From the documentation "MATLAB Runtime only works on MATLAB code that was encrypted when the deployable archive was built. Any f...

2 years ago | 0

| accepted

Answered
Matlab on two computers, one at work and one in laptop
It depends on the terms of your license. Check with your license adminstrator (if you're using your company's or educational ins...

2 years ago | 0

Answered
Hi When I run my code I got an error message "Invalid expression. Check for missing or extra characters" for my if loop. I am not sure why. Someone there can help me?
u1 = @(x, y, t) 0 u2 ... = @(x, y, t) 0 % u3 % = @(x, y, t) 0 Don't split the code among multiple lines (as u1), or if you...

2 years ago | 0

Answered
Why is dot (".") not considered an operator?
This documentation page lists it in the "Special Characters" section. [To be fair it also lists the colon operator in that table...

2 years ago | 1

Load more