Answered
Troubles with data types: integers, doubles, scientific notation, and type casting
Which release of MATLAB are you using? The ability to specify the subscripts (the first two inputs) in the sparse function as ar...

6 years ago | 0

Answered
function with two outputs
I'm taking a guess at the problem you're experiencing. In order to obtain one or more outputs from a function, two conditions m...

6 years ago | 0

Answered
Help in understanding ode45 options
That is an old syntax, one that remains for backwards compatibilty purposes, for passing additional parameters into functions sp...

6 years ago | 0

| accepted

Answered
Different functions with different variables as input
A cell array is one option, but there are at least three potential drawbacks I see with that approach. The first drawback is th...

6 years ago | 2

Answered
Using for loop to match generated random numbers to an input value
You have no control over how many iterations it will take to match the number the user chose, so a for loop (which has an upper ...

6 years ago | 0

Answered
Data string unreadable in matlab
The first output argument from xlsread contains the numeric data from the file. Your text data doesn't represent a number so it ...

6 years ago | 0

Answered
Data Extraction using Logical Operators
Instead of building your own binning function, consider using histcounts or perhaps histcounts2.

6 years ago | 0

| accepted

Answered
Use MATLAB’s symbolic function to integrate the following functions:
Use the int function.

6 years ago | 0

Answered
Compute the Triple Integral
Use integral3.

6 years ago | 0

Answered
Conditional Statements & Loops
Each time you process an element of x, you're overwriting the whole of y. You want to overwrite only the element in y correspond...

6 years ago | 0

Answered
Unrecognized function in reinforcement learning toolbox
This function was introduced in Reinforcement Learning Toolbox in release R2020a according to its documentation page. Are you us...

6 years ago | 0

| accepted

Answered
Variable originally saved as a structure cannot be instantiated as an object and will be read in as a uint32
I'm guessing you are able to create and work with struct arrays, which is one of the built-in types in MATLAB. I suspect your ed...

6 years ago | 2

| accepted

Answered
help me plis im using matlab 2018a
The wavplay function was removed in release R2014a. The Release Notes recommends using audioplayer and play instead.

6 years ago | 0

Answered
How to eliminate the junk values in the index
x = [1 2 3 2 3 4 2]; locations = find(x == 2) The output of this find call has three elements (2, 4, and 7) since x contains t...

6 years ago | 0

Answered
how do I know which tool box is required for each function?
Fangjun Jiang has pointed you to the function lists in the documentation. As another approach, I recommend contacting the MathWo...

6 years ago | 0

| accepted

Answered
array and matrix multiplication condition
See the tables and the information on this documentation page for a discussion of array versus matrix operations and a list of s...

6 years ago | 0

Answered
Parse error while defining a state vector
The square bracket at the end of the first line where you define A ends that definition. The square bracket at the end of the se...

6 years ago | 0

| accepted

Answered
Relational operators == for more than 1 or 2 elements?
Use ismember.

6 years ago | 0

| accepted

Answered
Why I can not save as or print figures in Matlab 2017a
Have you written or downloaded a function named print that's taking precedence over the print function in MATLAB? Check this wit...

6 years ago | 0

Answered
yline don´t work "Undefined function or variable 'yline'." Even when using MATLAB example code.
As stated at the end of the documentation page for the yline function, that function was introduced in release R2018b. You will ...

6 years ago | 0

| accepted

Answered
How can I change hours into numbers?
You're trying to convert a number of hours into a percentage of a day? h = hours(8.5) % or hours(8)+minutes(30) d = days(h) S...

6 years ago | 0

Answered
function for categorizing numerical array by size
Use histcounts. The histogram function is similar but creates a histogram plot. histcounts just does the binning (no plot) and ...

6 years ago | 0

Answered
Unit tests fail on "even" runs, but pass on "odd" runs (alternating pass/fail)
You add a directory (or multiple directories) to your path but you never restore the path to the state it was in prior to the te...

6 years ago | 0

Answered
I can't start my MATLAB R2016b
See this Answers post.

6 years ago | 0

| accepted

Answered
Error using sym>convertChar (line 1459)
As stated in the Note at the top of the documentation page for dsolve "Support for character vector or string inputs will be rem...

6 years ago | 0

Answered
Xticks single or double values increase
Look at the last two elements of the vector you're passing into xticks. Is the last element greater than the next-to-last elemen...

6 years ago | 1

Answered
Taking the norm of every 1x3 vector inside a 60x3 data
Use the vecnorm function. A = gallery('moler', 6) normOfEachColumn = vecnorm(A) twoNormEachRow = vecnorm(A, 2, 2) checkNorm...

6 years ago | 0

Answered
ode45 change function index when something happends
Rather than changing your ODE function "on the fly" like this, you probably want to use a restart-based approach. Solve the sys...

6 years ago | 1

Answered
Confusion with interp3 and interpn
I think reading through this documentation page may be of use to you, especially the examples in the Grid Representation section...

6 years ago | 0

| accepted

Answered
Trying to package anonymous function + function parameters in a structure
Your anonymous function takes a "snapshot" of the variable myStruct as it exists when the anonymous function is taken. The only ...

6 years ago | 1

| accepted

Load more