Answered
How to convert a string like "2.0:0.25:10.0" into a vector of floats?
Rather than using eval (or str2num which uses eval internally), since you know the exact format of the text data I'd split the s...

3 years ago | 2

Answered
"Invalid color or line style." Error during plotting in Executable
Read the "Using a MATLAB File You Plan to Deploy" section on this documentation page. Inside your application as you've written ...

3 years ago | 0

| accepted

Answered
When can Matlab support unicode variable names like some other programming language
In general MathWorks doesn't comment on whether or not something is on our future plans. If you feel strongly that MATLAB should...

3 years ago | 0

Answered
Kindly help me out with this code. its urgent please .thanks
Looking at one sample line from your HB function: dxdt(3) =-(((2*h*sin*x(1))/((cos)^3*(x(1))))+((c*(cos^2)*x(1)+2*(sin)^2*x(1))...

3 years ago | 0

| accepted

Answered
Hello everyone, I have date and time data in an excel separately. That is, year in one column, month in another, day in another column, and time in another column. how can i r
Read the data into MATLAB using your favorite approach then call datetime. data = [... 2023 4 21 20 2023 4 21 21 ...

3 years ago | 0

Answered
Is there a way to run particleswarm on multiple computer nodes?
See the "Processor Network" section on this documentation page.

3 years ago | 0

Answered
Is now supported a period in class method names (except 'set.*' constructions)?
Previously (R2022a), I have seamlessly used such convenient constructions as "add.Filter" or "add.Channel" as class method names...

3 years ago | 0

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 | 0

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

Load more