Answered
i need to create variable name using for loop from a table
Can you define variables with numbered names like X1, X2, X3, ... ? Yes. Should you do this? Generally we recommend against it....

4 years ago | 1

Answered
Why is this coding showing that? What's the problem here?
The main problem with your line 10 is that square brackets are not used for calling functions. They are used for concatenating a...

4 years ago | 0

Answered
How to distinguish specific nodes in an undirected graph ?
Create a sample graph and define some sample load and capacity data. rng default G = graph(bucky); Load = (1000-800)*rand(num...

4 years ago | 0

| accepted

Answered
How do I get Volume Viewer functions to work?
Which release are you using? According to its documentation page orthosliceViewer and sliceViewer were introduced in release R20...

4 years ago | 0

Answered
error regarding syms symbolic mathtool
You're missing an operator between Rid and (R1+Rf). If you want to multiply those two quantities you need to explicitly specify ...

4 years ago | 0

Answered
assert() alternative to continue the test when finding an error
If you're using the unit testing infrastructure, use the verify version of the qualification API function you're using instead o...

4 years ago | 0

| accepted

Answered
Mean function returning super low ( and wrong) value for a specific variable
You can notice just by looking at the values that the real mean is nowhere close to -1.9e-17. Why can't the mean be close to 0?...

4 years ago | 1

Answered
Fixed node locations using graphplot() with Markov chains
Store the handle of the GraphPlot in a variable, h1 in the code below. adjacency1 = sprand(6, 6, 0.2); D1 = digraph(adjacency1...

4 years ago | 1

| accepted

Answered
Online Matlab is not working since past few days
Please send the code that you're running when MATLAB says it's encountered an internal problem to Technical Support and let them...

4 years ago | 0

Answered
Assigning Function Name with "for" loop
Can you define variables this way? Yes. Should you do this? The general consensus is no. See that Answers post for an explanati...

4 years ago | 0

| accepted

Answered
how to not use all input arguments in the function because some of the arguments are fixed?
You can use an anonymous function "adapter". f = @(in1, in2) max(in1, in2); % I could have used @max ...

4 years ago | 0

Answered
Matlab - debugging Fmincon
Are the points provided to your function exactly the same as the initial guess or do they differ by a very small amount, small e...

4 years ago | 0

Answered
Question about Use property validation
You can use a colon in the size validation section of the property definition (see Property Size Validation on this documentatio...

4 years ago | 0

Answered
using cosh and inverse cosh in matlab
What problem? A1 = 5+5i A2 = acosh(cosh(A1)) (A2-A1)/(2i*pi) Remember that as stated on Wikipedia "hyperbolic functions are ...

4 years ago | 0

| accepted

Answered
Solving algebraic equations without using symbolic variables
For one equation in one unknown, use fzero. y = 1; f = @(x) x + y; initialGuess = 42; % Find a zero of f(x) - 2 = 0 which ...

4 years ago | 0

| accepted

Answered
create intervals of equal length but sequential
So into which interval should a value of exactly 90 fall? Interval 1, interval 2, or both? I think that depending on what opera...

4 years ago | 0

Answered
adding constaints to fmincon code
See the description of the lb and ub input arguments and the "Minimize with Bound Constraints" example on the documentation page...

4 years ago | 1

| accepted

Answered
error while installing MATLAB in MacBook m1 pro
What happened when you tried the steps suggested in the MATLAB Answers post linked in the error dialog?

4 years ago | 0

| accepted

Answered
sum on empty arrays
sum(zeros(0,0)) This is a special case, see the definition of the input argument A on the documentation page for the sum functi...

4 years ago | 0

| accepted

Answered
error using plot data must be numeric, datetime, duration or an array convertible to double
Let's see what you're trying to plot. t=[0:0.1:50] syms s gs=1/(s^2 + 5*s + 6); roots([1 5 6]); gjw=fourier(gs) If you wan...

4 years ago | 0

| accepted

Answered
I am a lecturer at MIPT. Used MATLAB under license from the university, And now I can't do it. Help me, what should I do?
It would be difficult if not impossible to offer specific suggestions without knowing more about what "I can't do it" means in t...

4 years ago | 0

Answered
Error tolerance in ODE45
Are you referring to the options in the Error Control option group in the table on this documentation page? If you click on the ...

4 years ago | 0

| accepted

Answered
Matlab crash on Ubuntu 20.04
Please send the script that you're running that causes this crash (along with any supplemental data and/or helper files needed t...

4 years ago | 0

Answered
An executable in the 2022a pre-release gets flagged as a threat by McAfee
Please send all questions or feedback about the Prerelease to Technical Support instead of posting them to MATLAB Answers.

4 years ago | 0

Answered
Accessing frequencies of arbitrarily selected histogram bins
Let's take a look at a sample histogram. I'm using rng default to create the sample data so the histogram created when you run t...

4 years ago | 1

| accepted

Answered
Run Section funcionality isn't working
Look in the upper-right corner of the Editor window. Do you see a red square or a red circle with an exclamation point in it? Th...

4 years ago | 0

Answered
matlab undo ctrl-z like in every other IDE or text editor
You probably want to switch to the Windows Default Set of keyboard shortcuts. Or you could customize just the Undo shortcut.

4 years ago | 0

| accepted

Answered
Calling latest version number of my own functions from one of my other functions?
The "workable, intelligent" solution would be to use a source control management system like Git. If for whatever reason that's...

4 years ago | 1

Answered
In surface(x,y,z) command what is the value of z that make the white color. I mean is there a color code for surface of surf
Many plotting functions interpret NaN in the data as "don't display anything." [x, y, z] = peaks; z(abs(z) < 1) = NaN; % Cut o...

4 years ago | 0

| accepted

Answered
Change class property inside of class function/method
Your class does not inherit from the handle class so it has value class behavior. See this documentation page for a discussion o...

4 years ago | 1

| accepted

Load more