Answered
set number of ticks at any given time
If you know the bounds over which your data to be plotted spans, I would set those limits first using axis or xlim and ylim (and...

3 years ago | 0

| accepted

Answered
make use of dynamic mkdir
Use the function form of mkdir rather than the command form. cd(tempdir) mkdir 1985379 % command form, creating a place for us...

3 years ago | 0

| accepted

Answered
Can anyone plot these function by using Matlab (R2023a version) or (R2023b version) and show me if there is any differenc between my figures and the Matlab (R2023a version)
Looking at the two pictures posted in this thread, I'm guessing the original poster had turned hold on (or had changed the defau...

3 years ago | 0

Answered
Passing path as input argument in matlab.engine
The run function in MATLAB accepts only one input, the name of a script file. Is your main.m a script file or a function file? I...

3 years ago | 1

| accepted

Answered
This expression is too large.
If you're generating the code for your block from a symbolic expression using matlabFunction or matlabFunctionBlock, as I suspec...

3 years ago | 0

Answered
Does an exsting license for "Statistics Toolbox" include Machine Learning, or is this a new product that needs purchased
You may want to read or skim this page about Machine Learning solutions and dig deeper into the specific application for which y...

3 years ago | 0

Answered
"Peppers.png" image source?
According to the file info it was modified (I believe created) in December 2002 and is copyright The MathWorks, Inc. I personall...

3 years ago | 0

| accepted

Answered
Defining Private and Public Fields within a Struct
No, all fields in a struct are publicly accessible.

3 years ago | 0

| accepted

Answered
Assign an input to an anonymous function
If you have a string or a char vector containing an equation: s = '2*x + x^2 + y' let's vectorize it so it can be called with ...

3 years ago | 2

Answered
Changing the parameter that affects the ODE solution based on the results of the previous step of the ODE
Don't attempt to change the ODE that you're solving on the fly like that. Use an Events function to stop the solver when certain...

3 years ago | 0

Answered
Why my y value went so high, whereas I using small value?
Look at the way you're calling your function in the loop: k1M1= dt*fRK4M1(M2(j),M3(j),O(j),P(j),M1(j)); and the way you've de...

3 years ago | 0

| accepted

Answered
R2023b prerelease for apple silicon become freezing back from sleep mode
Please send any questions or feedback related to a Prerelease of MathWorks products to Technical Support directly instead of pos...

3 years ago | 0

Answered
I have R2022b Matlab installed with license but cannot open some .mat files that my colleagues can with their Matlab
The files in the MATLAB Runtime are encrypted and cannot be read or changed. The MATLAB Runtime is not a general purpose MATLAB ...

3 years ago | 0

| accepted

Answered
which functions/argument pairs support argument passing via equality statments?
This Name=Value syntax for passing name-value arguments was introduced in release R2021a as stated in the Release Notes.

3 years ago | 0

Answered
accessing subplot grid title (sgtitle) from figure properties
The object created and returned by sgtitle has a Type that is not the same as its class. x = [1;1]*(0:15); y = randn(2, size(x...

3 years ago | 2

Answered
What the heck is a 1×0 empty double row vector and why does MATLAB create them?
Try 1:0 and the result is a "1×0 empty double row vector". Why? Why is it not the same as [ ]? The output of the colon operator...

3 years ago | 2

| accepted

Answered
Where is documentation for colon range of the form 1:vector?
The third item in the Description section of the documentation page to which you link describes what the colon, : operator does ...

3 years ago | 2

| accepted

Answered
Use placeholder for table
I know this thread is old, but in this scenario I'd create a function rather than a script. If the function accepts an input arg...

3 years ago | 0

Answered
Vectorize a table row with mixed numeric values
If I concatenate a logical type with any numerical type, it will promote the logical value to that numerical type, examples: Th...

3 years ago | 1

Answered
Sorting numbers that the largest is at a specified index, and then progressively smaller in both directions
x = [17 2 3 5 11 7 13] s = sort(x, 'descend') y = [flip(s(2:2:end)) s(1:2:end)]

3 years ago | 0

| accepted

Answered
Confusion with tic-toc and run times
What does your shorttimeoptimised function return? Does it return how long the operation took to run or does it return the resul...

3 years ago | 1

Answered
How to add seconds to a HH:mm DateTime array ?
Do you want to actually add seconds to the value (changing the time) or do you want to add seconds to the display (leaving the t...

3 years ago | 1

Answered
pca function returns the wrong output in R2022a
Let's check that you're using the pca function included in Statistics and Machine Learning Toolbox. What does this command show?...

3 years ago | 0

| accepted

Answered
What is the difference between int8(0x98), uint8(0x98), typecast(uint8(0x98), 'int8')
If you use the following syntax, you create a uint8 value and then cast that value to int8. Since the uint8 value is larger than...

3 years ago | 2

Answered
double conditional in one line
At the beginnnig looks like weird >> x=0.23: 0<x<1 This does not ask the question "Is x between 0 and 1 exclusive?" It is inst...

3 years ago | 1

| accepted

Answered
"y-direction of the coordinate system should be reverted"
Images and "regular" plots have different conventions for whether the Y axis should be increasing or decreasing as you move towa...

3 years ago | 0

Answered
Couldn't find helperVisualizeScene() function
Open the example in MATLAB using the command that gets copied to the clipboard when you press the "Copy Command" button. MATLAB ...

3 years ago | 1

| accepted

Answered
comparison between a string/or cell and categorical data
MATLAB is correct. Sis(1).Trading = 'As Is' Trading(1) = categorical({'As is'}) Sis(1).Trading==Trading(1) If you used a cap...

3 years ago | 1

Answered
Error using image Color data must be an m-by-n-by-3 or m-by-n matrix. Error in imagesc (line 52) hh = image(varargin{:}, 'CDataMapping', 'scaled');
As the error message says, the image data you pass into imagesc must be a matrix (if it's an indexed image or a grayscale intens...

3 years ago | 0

| accepted

Answered
How to create a "scatter" matrix without using a for loop?
row = [1,2,3]; col = [2,4,4]; val = [123,321,456]; M = accumarray([row.', col.'], val.', [4 4])

3 years ago | 0

Load more