Answered
APP Designer code convert to CPP code
If upgrading to a release (R2020a or later) that includes Simulink Compiler is an option, you might find the workflow on this do...

3 years ago | 0

Answered
How to obtain the piecewise expressions of spline fit obtained using MATLAB's command spapi?
i want to obtain the expression and calculate it derivatives further. Do you need the actual expression, or do you just want to...

3 years ago | 1

Answered
Add code to have switch repeat if a case is not met
You can simplify your switch call so you don't have to include 2^(number of letters) cases each with a different combination of ...

3 years ago | 0

Answered
How can I drawing equipotential lines?
Take a look at the contour function.

3 years ago | 0

Answered
installing two MATLAB versions at same time.
It is possible to have multiple versions of MATLAB installed on the same machine at the same time. Just don't install them both ...

3 years ago | 0

Answered
I need to understand what's the mistake and how to define vector
When MATLAB runs line 7 of your code, it tries to access the second element of the variable u (or to call a function named u wit...

3 years ago | 1

Answered
How to reduce the file size of a saved histogram figure
You could avoid creating the histogram using the data by specifying 'BinCounts' and 'BinEdges'. If you do this, there won't be a...

3 years ago | 1

| accepted

Answered
Is it possible to generate a Mex function which has within it another mex function?
I'm not 100% certain but if you're trying to generate code using MATLAB Coder on a file that calls a MEX-file, you may be able t...

3 years ago | 0

Answered
Join strings together with '_' between them
Use the string append operator +. a = {'A11';'A12';'A21';'A22';'A23';'A24'}; b = {'A300';'A5300';'A291';'A5291'}; C1 = a + "_...

3 years ago | 2

Answered
Identifying if reaction times are 3 standard deviations away from mean
Take a look at the "mean" method for the isoutlier function.

3 years ago | 0

Answered
Translate sine coding? Need understanding
To start off, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB. Then work you...

3 years ago | 1

Answered
How to fix the large and mad fractions when dealing with symbolic vars
Symbolically, use vpa or double or use the sympref function to change the FloatingPointOutput preference. Numerically, if you w...

3 years ago | 1

Answered
Why is my table displaying 1x1 in workspace but displays actual values in command window?
You're creating a timetable whose elements are tables. If you want to change a table into a timetable instead take a look at the...

3 years ago | 0

Answered
How to subtract ?
A=[0 1 2 3 4 5 6]; B = 12; C = B-cumsum(A)

3 years ago | 3

Answered
error when I try to open a file to edit
Do you have a function you've created named settings.m? Does the command below show just one item (in a subdirectory under toolb...

3 years ago | 0

Answered
how can i change the value of a variable with a slider in matlab designer?
Rather than changing the value of a fixed variable I would likely retrieve the Value property of the slider object whenever I ne...

3 years ago | 0

Answered
MPC toolbox computation time
If you're trying to analyze the performance of your Simulink model (to identify bottlenecks?) consider using Simulink Profiler.

3 years ago | 0

Answered
I wan to display an image of size 512x512x150 using matlab.
Take a look at the tools listed in the Volume Visualization section of the documentation.

3 years ago | 0

Answered
why my conditional function is not what I expected?
if X>=0 & X^2+Y^2<4 From the documentation for the if keyword: "if expression, statements, end evaluates an expression, and exe...

3 years ago | 1

Answered
Why isn't my figure consistent? It keeps changing every time
Here's one line of your code. I've put it in block comments so MATLAB Answers won't try to execute it, since I have other code l...

3 years ago | 0

Answered
Matlab coder support for fitdist
In general we don't comment on future plans. I recommend that you submit this as an enhancement request to Technical Support. If...

3 years ago | 0

| accepted

Answered
imhist and histogram giving different results
I suspect that imhist and histogram are just using different algorithms to select the bin edges in the case where you only speci...

3 years ago | 0

Answered
How to change folders in MATLAB App Designer ?
I would advise you to use fullfile to assemble your file paths rather than concatenation. I'd also be wary about assuming that p...

3 years ago | 1

Answered
Issue with N body problem using ode45
Are you certain on those satellite masses? Looking at Wikipedia the mass of the Great Pyramid of Giza is 6e9 kg. Are these satel...

3 years ago | 0

Answered
How to convert column datetime (yyyy-mm-dd HH:MM:DD.000) into MJD and decyear?
According to Wikipedia the modified Julian date is the number of days since November 17, 1858. It is also the Julian date minus ...

3 years ago | 0

Answered
Error using the 'square' interpolation method in interp1 function
I don't believe there was ever a 'square' interpolation method in interp1. But the input argument checking in much older version...

3 years ago | 2

Answered
What is the legal status of code examples on mathworks.com?
Please contact Customer Service for an official answer to legal questions about MathWorks examples.

3 years ago | 1

| accepted

Answered
how to display newline
If you're using release R2016b or later you can use the newline function, perhaps in conjunction with a string array. s = "appl...

3 years ago | 5

Answered
I cannot use "binornd" or "random" function
Both binornd and random are functions in Statistics and Machine Learning Toolbox. Do you have this toolbox installed and license...

3 years ago | 0

| accepted

Load more