Answered
Why do I get the error 'Unable to use a value of type cell as an index.'?
Is that table.m file that you have open in the Editor the one included with MATLAB, in which case you shouldn't have modified it...

5 years ago | 0

Answered
intersect between the second column of cell array A (for all rows) and the first column of cell array B (for all rows)
Let's make some sample cell arrays with animal names. [I'm assuming your cell arrays contain text data.] animals = {'dog','cat'...

5 years ago | 0

| accepted

Answered
write a polynomial answer in one operand
What do you mean by "solve" in this context? Do you want to find values of s that when substituted into those polynomials gives ...

5 years ago | 0

Answered
STRUCTURE RANDOM FIELD READING FROM TEXT FILE; WHAT REPLACEMENT OF 'genvarname ' ?
Use matlab.lang.makeValidName to ensure your candidate field name is a valid MATLAB identifier then use dynamic field names to s...

5 years ago | 1

| accepted

Answered
Execution of script fzero as a function is not supported:
You likely wrote or downloaded a script file named fzero.m that's taking precedence over the fzero function included in MATLAB. ...

5 years ago | 0

Answered
Which one is correct ? Using (' ') or @(var)
Some older functions allow you to specify the name of a function to call. But if you're writing code to use in a recent release ...

5 years ago | 0

Answered
To add two datetime arrays , with millisecond values
You cannot add two datetime arrays as the error message indicates. If addition of datetime arrays was defined, what would be the...

5 years ago | 1

Answered
Error in code for plot
x=linspace(0,2.*pi,101) plot(x,sin(x),'markeredgecolor','r',... x,cos(x),'markeredgecolor','g',... x,tan(x),'markered...

5 years ago | 0

| accepted

Answered
when I open already existing M file in MATLAB I get error using open(line146) failed to open MATLAB editor
Let's make sure you're using the settings function included with MATLAB as MATLAB expects. What does this command show? which -...

5 years ago | 0

Answered
histcount does not work as excepted
From the documentation page: The value X(i) is in the kth bin if edges(k) ≤ X(i) < edges(k+1). The last bin also includes the r...

5 years ago | 0

| accepted

Answered
I have a mistake in loops
Does your problem ask you to find all Pythagorean triples whose elements sum to less than 1000 or all whose elements sum to less...

5 years ago | 2

| accepted

Answered
Instead of skipping first column of matrix the for loop puts first element as a 0.
You created a by assigning to its second element. The first element cannot be empty, it has to have some value. The two most obv...

5 years ago | 0

| accepted

Answered
quiver(___,scale) invalid text character.
I'm not certain offhand where this is documented, but whenever you see ___ in the Syntax section of a function reference page it...

5 years ago | 0

Answered
Matlab is unable to evaluate very a very long expression
How did you generate this long expression? Did you generate this using Symbolic Math Toolbox? If so consider using matlabFunctio...

5 years ago | 1

| accepted

Answered
use of svds with function handles
When in doubt, check the documentation page to see if there's an example you can adapt. In this case there is, "Largest Singular...

5 years ago | 2

| accepted

Answered
Why does the modulo function seem to break for large numbers?
For sufficiently large numbers, not all numbers in that vicinity are representable in IEEE double precision. What's the distance...

5 years ago | 2

Answered
Replace array elements with strings
I recommend using a table array to store your data of mixed types. load patients T = table(LastName, Age, Smoker); head(T) % ...

5 years ago | 0

Answered
"save as" interface
Why not just use the uiputfile function included as part of MATLAB?

5 years ago | 0

| accepted

Answered
When I import this function, there is a error when I run this codes.
Is this line: importfile('gravity_anomaly_.mat') inside the importfile function or do you run this in the Command Window? I s...

5 years ago | 0

| accepted

Answered
What Mistake I am making in the code
FYI you can perform a swapping operation in one step without needing an explicit temporary: x = (1:10).^2 toSwap = [4 7] x(to...

5 years ago | 0

Answered
how can I use mexw32 files on my 64-bit matlab?
Ask the person from whom you obtained the .mexw32 file (a 32-bit Windows MEX-file) for the corresponding .mexw64 file (a 64-bit ...

5 years ago | 0

Answered
renaming a variable, or creating a dynamic variable name
If the elements of sampleNames are valid MATLAB identifiers I think Walter Roberson's suggestion to store each table in a field ...

5 years ago | 1

Answered
Building a Markov Chain Graph (directed graph) with large number of nodes/states
What layout are you using to have MATLAB determine the coordinates at which the nodes should be plotted? Depending on how sparse...

5 years ago | 0

Answered
How to write MATLAB code for system of 4th order ode?? Plz help me guys
Follow the model of the "Nonstiff van der Pol Equation" and "Nonstiff Euler Equations" examples on this documentation page. Conv...

5 years ago | 0

Answered
The variable already defined ,but in the design apps it cannot recognized the variable.
Energy = app.EnergyUsageEditField; Bill = Tariff(Energy); You're passing the handle of an edit field in your app into Tariff. ...

5 years ago | 0

| accepted

Answered
Matrix math with Datetime arrays
Support for implicit expansion for certain operations on datetime, duration, calendarDuration, and categorical arrays was added ...

5 years ago | 0

| accepted

Answered
Plotting complex function with real and imaginary parts, but also with respect to the variable itself
Something like this? x= [25 40 50]; fx= [49.19-44.57i, 78.70-71.31i, 78.70-71.31i]; plot3(x, real(fx), imag(fx))

5 years ago | 0

Answered
Hello! My script is correct to what I see and know but it is still not displaying the x-axis names of the categorical data.
Since you didn't tell MATLAB to hold the axes each of your bar calls resets most of the axes properties to their default states ...

5 years ago | 0

Answered
When plotting the symbolic version on the curve fit polynomial they do not match.
Don't copy the coefficients. You're not copying them to their full precision. Instead export the fit from the app (or generate c...

5 years ago | 1

| accepted

Answered
Dot notation with multiple dots in it
Dot has several different meanings in MATLAB. It can be used for method invocation as you mentioned. It can be used for property...

5 years ago | 0

| accepted

Load more