Answered
How to convert a function handle to symbolic function?
Are you hoping to use this fit object as the right-hand side of a differential equation ? If so keep in mind that fit objects ha...

2 years ago | 1

Answered
bitshift in matlab vs ishft in fortran
Instead of using bit operations yourself, why not just use typecast? t = 'int32'; x = randi([intmin(t), intmax(t)], 1, 2, t) %...

2 years ago | 0

Answered
N-dimension curve fit how to
See the Multiple Regression section on this documentation page. While that example only uses the first power of each of the vari...

2 years ago | 0

Answered
Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code?
Parentheses Generally speaking, using parentheses to index into a variable usually does one of two things. If the variable is ...

2 years ago | 2

| accepted

Answered
How do I print a % character into a file
If you don't need str inside your code other than to write it to the file, rather than creating it just write directly to the fi...

2 years ago | 1

Answered
Why do we get MATLAB fatal errors saying “Access violation detected”?
Please contact Technical Support directly using this link. Send any crash log files to Support and work with them to determine t...

2 years ago | 0

Answered
Why is 0.3 - 0.2 - 0.1 not equal to zero?
Starting in release R2024b, you can use the isapprox function to determine if two values are approximately equal to within a tol...

2 years ago | 1

Answered
Colon operands must be real scalars
For the expression you gave there are a few possible "reasonable" solutions for what it returns. [But it may not do what you thi...

2 years ago | 0

Answered
Heatmap doesn't show the values
Let's check that you're using the heatmap function included in MATLAB and not a different heatmap.m that you've written yourself...

2 years ago | 2

| accepted

Answered
Some indices in indexed images made with cmunique are 0, what does that really mean? Isn't is a bug? I cannot index a colormap with index=0. Documentation is contradictory.
0 is a nonnegative integer value. isZeroNegative = 0 < 0 % false isZeroInteger = 0 == round(0) % true If you're using Imfig_i...

2 years ago | 0

Answered
assign the fields of a structure correctly
Is d1 a struct array whose fields you need to rearrange? d1 = dir(which('bench.m')) If so you can use orderfields. I'm going t...

2 years ago | 0

Answered
Differenece between "MATLAB for the MathWorks Certified MATLAB Associate Exam" and "MATLAB Fundamentals"
If you click "Learn More" in the "This course will be discontinued" banner on that course, it suggests the "Build MATLAB Profici...

2 years ago | 0

Answered
error in symbolic convolution using integral and isAlways
Are you trying to tell MATLAB that % lam_f > 0 & u_f > 0 & sigma > 0 or are you trying to ask MATLAB if those three conditions ...

2 years ago | 0

Answered
How to stop unwanted rows being added when constructing a matrix in a for loop
Since you're creating matrices with diagonal bands, consider using the diag or spdiags functions. n = 7; mainDiagonal = diag(6...

2 years ago | 0

Answered
Individual User License usage conditions
Please contact Customer Service directly using this link or contact the Sales department directly using this link for help with ...

2 years ago | 0

Answered
Issues using 'readtable' (MATLAB 2024a)
Let's check that you haven't accidentally defined a length.m function that does not behave the same way as the one included in M...

2 years ago | 0

| accepted

Answered
Problems with query points
According to the information you provided when you asked the question, you're using release R2023b. Looking at the documentation...

2 years ago | 0

Answered
Generate mlint warning when variable is not unused
Is it possible to generate a warning when a variable is not used. More exactly, I would like to have the following behaviour: a...

2 years ago | 1

| accepted

Answered
Reading columns from a poorly-formatted text file
I would experiment with the settings controllable using the Import Tool to try to import the data. You could try running Import ...

2 years ago | 0

Answered
How can I fix this error? 'Error: File: RSM_yeni.m Line: 84 Column: 19 Invalid array indexing.'
Looking at this line in your code (commenting it out so I can run code later in this answer) %{ constraint = @(x) fun(x)(1) - ...

2 years ago | 0

Answered
linprog send wrong output
Your objective is written mathematically as "max 350 x1 +3 x2 +3.5 x3 +3.5x4" but the c vector you've defined is "c=[-300 -300 -...

2 years ago | 1

| accepted

Answered
Linkdata not refreshing graph
As written, this is going to recreate the figure and the plots each time through the while loop. Do you want to move those ahead...

2 years ago | 0

| accepted

Answered
MATLAB crashes on macOS Sonoma when clearing a figure.
I looked for a Bug Report that seemed relevant. None strike me as obviously related to this crash from the information you provi...

2 years ago | 0

Answered
While cycle with conditions never ending
while (Dice1&&Dice2)~=6 This line of code doesn't do what you think it does. (Dice1 && Dice2) is either true (if both Dice1 an...

2 years ago | 0

Answered
Solution for using rowfun but with a function handle ?
I want to address the points in your question slightly out of order. rowfun doesn't work with function handle, and arrayfun als...

2 years ago | 0

| accepted

Answered
Prevent mlint warning for onCleanup like return value
So I wrote a cleanup function which accepts parameters, so you can write cleandir = onCleanup_lazy( @(x) cd( x ), pwd ); B...

2 years ago | 0

| accepted

Answered
Solve differential equation for a sequence of k values
The ballode example included in MATLAB does something like this, though instead of dividing the interval that the ball is in mot...

2 years ago | 0

Answered
How to apply NonNegativity constraint in ODE solver when defining ode as a structure
The relevant property of the ode object to specify that some of the variables must be non-negative is NonNegativeVariables. Afte...

2 years ago | 0

Answered
Unable to recognise function from called script
Local functions in a script are only directly callable from within that script file. You could call them indirectly by calling t...

2 years ago | 0

Answered
Faster alternate to all() function
Are you sure the longest time is spent in all? Reducing the size of the varname variable and the number of iterations a bit (so ...

2 years ago | 1

Load more