Answered
Need Help With Function Creation and Integration
What do you know (and have fixed values for) and what are you trying to integrate over? Since nowhere in the code for the funct...

2 years ago | 0

Answered
Why does expm command work too slow?
Do you absolutely need the result as a (potentially very long) symbolic expression in t, or is computing this matrix exponential...

2 years ago | 0

Answered
Why does MatlabR2023b frequently crashes when generating figures
Searching the Bug Reports for release R2023b for "crash" in the MATLAB product I find seven hits, but none of them seem like the...

2 years ago | 0

Answered
How I would determine if a string contains multiple substrings?
myString = "This has some words in it."; s = split(myString) whichWordsAreIn = ismember(["some"; "in"], s) allWordsIn = all(w...

2 years ago | 0

Answered
Audio Toolbox transcribe not working even with toolbox and license
Looking at the documentation page for the speech2text function, I see a Note in the Decription section that looks relevant. "To...

2 years ago | 1

| accepted

Answered
The code runs when if I do; newton_recur(@(x) x^2,@(x) 2*x,1,10) but wont work if I leave out the @(x). is there a way to do this so that the user doesn't need to add @(x)?
You mean you want the user to enter 'x^2' and '2*x' and automatically generate the anonymous functions? Take a look at the vecto...

2 years ago | 0

Answered
How to Convert data from HEX codes to Numeric
Do you mean you have the hex representation of a double precision number and want to convert it into the corresponding double? S...

2 years ago | 0

Answered
How to count the occurrence of numbers in certain value range (show 0 if no occurrence)
If your data is sorted you could use histcounts. In the case of your sample data, where all the values are integers, I'm going t...

2 years ago | 1

Answered
Matlab generate normal random sample with outliers
warning('off','all') Seeing this in the code smells bad. If you want to select a different element each iteration (and have en...

2 years ago | 1

| accepted

Answered
Using repelem to vertially concatonate non-numeric variable
Note that the for loop approach from @Atsushi Ueno works if the "pieces" of the names are the same length all the way down the l...

2 years ago | 0

Answered
i want to find k for different values of w using determinants, after that i want to find y2 for the different values but y2 cannot be executed
w is a vector. w=1:3 y1(j) is a scalar. For purposes of this example I'll show a "dummy" y1 vector. y1 = [4 5 6]; j = 1; y1...

2 years ago | 0

| accepted

Answered
How do i fix my newtons method code?
There is one obvious syntax error, one functionality error, and one change I strongly recommend. Recommended change On the lin...

2 years ago | 2

Answered
How to change a parameter of an objective function during optimization of simulated annealing ?
Now, my objective function has an extra parameter, in addition to the independent variables, which is a variable that I want to ...

2 years ago | 0

Answered
Error with fmincon Unable to resolve the name 'optim.coder.validate.checkProducts'.
What does this command show? which -all fmincon And do you have MATLAB Coder installed? I suspect the answers to those two que...

2 years ago | 0

Answered
How to center the bars of the histogram over the elements of the input array?
thanks a lot @Star Strider, but why do we get frequency = 5 for x = 4 ? Shouldn't it be frequency = 2 for x = 4? BinWidth and ...

2 years ago | 2

| accepted

Answered
Inverse Matrix for 6x6 matrix with variables
The symvar function does not define symbolic variables. It identifies identifiers in an expression (other than those in a small ...

2 years ago | 0

Answered
Error Not same Vector length why not functioning
Just as a guess, did you expect this to create a 20 element vector whose first element is 0 and whose last is 2001? t1 = linspa...

2 years ago | 0

| accepted

Answered
How to know exactly what row (or index number?) in a table based on user input?
If you had a timetable array, you could either use the == operator as others have suggested or create a timerange (if you need t...

2 years ago | 0

Answered
problem axis "x" in my graph
Those seem reasonable to me. They're showing the month and date along with the time of data for each of your X coordinates. I su...

2 years ago | 0

Answered
Help with axes labels on histogram plot
If you want the labels to be only in the center of the bars, use the BinEdges property of the histogram to compute where the tic...

2 years ago | 0

Answered
Problem to call fitcecoc with Matlab runtime
If you are attempting to compile code using MATLAB Compiler that calls load to load an object from a MAT-file and there is no in...

2 years ago | 0

Answered
MATLAB built-in examples not opening and giving error
According to the Release Notes for Simscape Electrical, the names of the example models and/or the way you access them changed i...

2 years ago | 1

| accepted

Answered
Load data and store in workspace in individual variables
Can you dynamically create variables with numbered names like x1, x2, x3, etc.? Yes. Should you do this? The general consensus ...

2 years ago | 0

Answered
"Invalid use of operator." doesn't go even after trying various solutions :(
That doesn't match any of the allowed syntaxes shown on the for keyword documentation page. If you want the code to run only if...

2 years ago | 0

Answered
Error using sym/subs Too many input arguments. Error in mx_model (line 176) f = subs(f, cup,cu,0);
In the past the subs function for symbolic expressions did accept four inputs. The last input controlled whether or not we tried...

2 years ago | 1

Answered
Error Saving figure: Error using sprintf: Conversion to text from matlab.ui.Figure is not possible.
Your full error message references line 63 in the savefig function, which in the savefig function included in MATLAB: which -al...

2 years ago | 3

| accepted

Answered
while closing the GUI in MATLAB 23a give following error
You could wrap that set call in a try / catch block and check if the handle to the text box isvalid in the catch block. If it is...

2 years ago | 1

| accepted

Answered
How to build polynomial with cscvn function coeffs?
If you want to evaluate the spline, don't try to make polynomials. Just use the output argument from your call to cscvn with the...

2 years ago | 0

Answered
Array indices must be positive integers or logical values.
Did you mean r*(1-tau) instead of r(1-tau) in the command in the innermost for loop?

2 years ago | 0

| accepted

Answered
External Users Viewing Fig file
No, as far as I'm aware there is no stand-alone viewer for .fig files. One approach you could use to allow your users without MA...

2 years ago | 0

Load more