Answered
Incremental conditions for if statement
If you want to check if a number is not in a given set, use ismember. x = 1:10; if ismember(5, x) disp("5 is in x") else...

5 years ago | 0

| accepted

Answered
MATLAB : find a way with GPU NVIDIA to inverse quickly a large matrix of symbolic variables
To elaborate on what John D'Errico said: for n = 2:6 A = sym('A', [n, n]); tic IA = inv(A); t = toc; f...

5 years ago | 0

Answered
rng function in matlab
what is porpuse of the state field? It is the state of the random number generator. For most users of rng you can ignore what t...

5 years ago | 0

Answered
Function definition using a variable from a block based on a for loop
For this I'd use one of two approaches. A=[1 2 3 4 5 6 7 8 9 10]; Att=[0 2 4 6 8 10 12 14 16 18]; % Approach 1 y = myf1(At...

5 years ago | 0

| accepted

Answered
why fprintf have a double class but sprintf have char
Because that's what they're documented to do. The documentation for the sprintf function states "str = sprintf(formatSpec,A1,.....

5 years ago | 0

| accepted

Answered
Different results for formula in Matlab and Excel
The problem is operator precedence. Here are the rules for operator precedence in Microsoft Excel and here are the rules for MAT...

5 years ago | 2

| accepted

Answered
Error: Array indices must be positive integers or logical values.
-2*zeta2(z(4)-z(2)) Is z(4)-z(2) guaranteed to be a positive integer value suitable for use as an index into the variable zeta2...

5 years ago | 0

| accepted

Answered
Call function in package from package
Everything I'm writing here is my own opinion about what would happen if we made the change requested in this discussion thread....

5 years ago | 1

Answered
unclear number of if or maybe other commands?!
So you want to discretize your data? x = rand(10, 1); binedges = 0:0.25:1; values = [1.1, 2.22, 3.333, 4.4444]; d = discreti...

5 years ago | 0

| accepted

Answered
how to create helperCropPointCloudsAndMergeLabels function?
Open the Live Script containing the example in MATLAB using the "Open Live Script" near the upper-right corner of the page in th...

5 years ago | 1

Answered
The end operator must be used within an array index expression.
In this case read is a function, not a variable. Attempting to "index" into the function with end won't work. I would probably r...

5 years ago | 2

Answered
Problem with adding integers
Set an error breakpoint and run your code. When you reach the line that throws the error, check that what you believe to be true...

5 years ago | 0

Answered
scatter plot (need matlab script)
That doesn't look like a scatter plot. It looks more like a heatmap chart. Though you are going to need to bin your data if you ...

5 years ago | 1

Answered
Create an array of empty durations
Another way to create an empty array of duration objects is to use the empty function for the class. d = duration.empty(5, 0)

5 years ago | 1

Answered
Error using round every time can anyone please help me with this?
The round function for symbolic expressions does not accept the input argument N (the number of digits to which to round) like t...

5 years ago | 0

Answered
Rounding off and approximation functions.
N = 14; x = 2.^nextpow2(N)

5 years ago | 0

| accepted

Answered
Does a site license work when offline; if so, how long before it needs to be refreshed?
One option would be to check with your IT department (or whomever maintains your licenses) to see if license borrowing is enable...

5 years ago | 0

| accepted

Answered
How to I know this file? It is a .p file.
Constantino Carlos Reyes-Aldasoro is correct. If you want to see the implementation of a P-coded file you will need to ask the a...

5 years ago | 0

Answered
Why linsolve cannot solve this very simple equation?
The vector [6; 7; 11] is a solution to the problem but it is not the only solution. A = [4,2,2; 5,1,3; 6,0,4]; B = [60; 70; 80...

5 years ago | 0

Answered
Help needed in some qutions about normalize histogran functions(in Q3 bulding like "plot (X'Y)
Read through the documentation page for the histogram function to see if it has any options and/or properties that will be of us...

5 years ago | 0

Answered
Solve system of higher ODEs
Apply the techniques shown on this documentation page to turn your system of higher order ODEs into a larger system of first ord...

5 years ago | 0

| accepted

Answered
How would I perform logical comparisons with times given in the form of a string vector?
% time = datenum(temptime); Instead of converting the dates and times to serial date numbers, I recommend converting them to a ...

5 years ago | 0

Answered
actxcontrol and actxserver: Future support plans?
1. Is there an announced time-frame for removing the actxcontrol( ) command? If you're looking for something more concrete than...

5 years ago | 1

Answered
Split Table data based on Day Names
Do you want to have seven individual variables or do you want to operate on the set of rows in your table data where each row in...

5 years ago | 0

Answered
How can I fix the problem of deep network designer in MATLAB?
Which release of Deep Learning Toolbox are you using? If you're using a release prior to R2019a I suspect though I'm not certain...

5 years ago | 0

Answered
Passing structs/objects to functions
Just because MATLAB passes a large array into a function doesn't mean it needs to make a copy of that array if you don't modify ...

5 years ago | 0

Answered
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
for 1=1:n, The number 1 is not a valid variable name in MATLAB and so cannot be used as the loop variable in a for loop.

5 years ago | 0

Answered
How to open Matlab with specific scripts in my editor?
Consider setting up different Projects for your different projects.

5 years ago | 0

Answered
How to replace specific values to all values of a bin ?
Specify the values input argument in your discretize call. x = 6*rand(10, 1); d = discretize(x, 0:2:6, [1.6, 3.8, 5.7]); resu...

5 years ago | 3

Load more