Answered
How to change properties of several plots simultaneously?
x = 0:360; y1 = sind(x); y2 = cosd(x); figure h1 = plot(x, y1); figure h2 = plot(x, y2); set([h1, h2], 'Marker', '^',...

6 years ago | 2

Answered
I want to produce square wave without using square function, but this code it showing error, "illegal use of IF keyword". How to rectify it?
In some languages (like C) you need to use {} around sections of code (like the bodies of for loops or if statements.) MATLAB is...

6 years ago | 0

Answered
scatter plot with color dependent on variable.
Use the c (usually the fourth) input when you call scatter. See the "Vary Circle Color" example on the documentation page. You w...

6 years ago | 0

Answered
How to fill a cell with function handles using iteration numbers?
c = (1:10).^2; G = cell(size(c)); for whichElement = 1:numel(c) G{whichElement} = @(x) c(whichElement)*x; end Yes, when...

6 years ago | 0

| accepted

Answered
For loop optimization in matrix operations
You don't need to loop to generate the values that you multiply by +1i or -1i and pass into exp. % Sample data x = randn(4, 5,...

6 years ago | 0

Answered
Why is it that the breakpoint does not work?
The body of a parfor generally doesn't run in the MATLAB session in which you're running the parfor. As stated in the "Test parf...

6 years ago | 1

Answered
MATRIX INVERSION TAKING FOREVER TO RUN
In general, you should not invert matrices. I suspect you're trying to work symbolically in which case you absolutely should not...

6 years ago | 0

Answered
Index into 32 bit word to extract relevant data
Use the bit-wise operations functions or use rem, mod, subtraction, and division.

6 years ago | 0

Answered
Saving all Superclass properties inside one subclass property
Should FeatureDatabase inherit from Feature (be a Feature?) Or should FeatureDatabase have a property that contains an array of...

6 years ago | 0

| accepted

Answered
Can third party extract code from standalone desktop app developed using app designer matlab?
When you use MATLAB Compiler, the code is compiled into an archive that is encrypted using AES. I am not aware of any computatio...

6 years ago | 1

Answered
Call vector by key
Depending on what else you want to do with this data, storing it in a timetable may be useful. Using one of the examples on the ...

6 years ago | 0

Answered
rand() gives the same values in each run
Are you initializing the random number generator with rng too frequently or in the wrong place in your code flow?

6 years ago | 0

| accepted

Answered
matrix component algebra with digraph
R = randi([0 1], 10) D = digraph(R); OD = outdegree(D) R./OD Be careful of the case where one or more of the nodes has outde...

6 years ago | 0

Answered
objects of one class into another class
Your clwinding class is syntactically valid. Your clloss class, on the other hand, has some conceptual errors. I'm going to mak...

6 years ago | 1

Answered
How to store objects from different classes in one array and call the same function (definitions are different)?
See this documentation page for how to implement your classes so you can create a heterogeneous array. By the way, I recommend ...

6 years ago | 0

Answered
Once I have downloaded R2020a of MATLAB on my windows pc, it won't let me run the application. What could be the issue? (I have uninstalled it and re downloaded it)
If you open the matlab_crash_dump files, there should be a note at the end that tells you how to send that file to MathWorks. If...

6 years ago | 0

| accepted

Answered
How can i get an activation key ? the matlab program does not open with out the activation key , please help me to get a solution for this problem? my work based on matlab program
When you bought the software you should have received the instructions and information you'll need to install the software, most...

6 years ago | 0

Answered
How to skip '.' and '..' directory while looping over files in a folder?
You probably don't want to filter just '.' and '..', you probably want to filter all directories. You also shouldn't assume that...

6 years ago | 0

Answered
Error using 'Save' including quotation marks around variables
My guess is filename is a cell array containing a char row vector. x = 1:10; thefile = 'data571924.mat'; save(thefile, 'x') %...

6 years ago | 0

Answered
Not enough input arguments
I suspect you've written or downloaded a sym.m that's taking precedence over the one included in Symbolic Math Toolbox. In my in...

6 years ago | 0

Answered
Best way to present histogram with different realisation number
In the "Plot Multiple Histograms" example on the documentation page for histogram, we show one way to give two histogram objects...

6 years ago | 0

Answered
Polyfit 4th degree unexpected behavior
It looks to me like tp(:, 1) is not sorted. You can check this with issorted. If it's not sorted, MATLAB may draw a line from ar...

6 years ago | 2

Answered
How to set the terminal condition of the Matlab built-in function roots?
You don't. roots builds the companion matrix and computes the eigenvalues of that matrix. I can't see the context before that s...

6 years ago | 0

| accepted

Answered
What is the largest number of rows of a matrix that Matlab can handle?
The theoretical limit is the number returned as the second output of the computer function. The practical limit is based on how...

6 years ago | 0

Answered
Creating a built in function?
You cannot add a built-in function to MATLAB like we at MathWorks can. But you can make the MATLAB scripts, functions, and/or cl...

6 years ago | 2

Answered
how to create a table in Matlab ?
In release R2016b (the release with which this answer was marked) table variable names must be valid MATLAB identifiers, which m...

6 years ago | 0

Answered
Appending arrays of different length
Use datetime, hours, and the colon operator : to build your array of dates and times all at once. Note that when doing so you wi...

6 years ago | 0

Answered
Adding a folder when building an standalone application
You cannot have a standalone application run code that was not compiled into the application when it was created. From the docum...

6 years ago | 0

Answered
How can I use some downloaded function?
Where on the MathWorks website did you download the files? If you downloaded them from the File Exchange, I recommend using the ...

6 years ago | 2

Answered
Advice needed with the dateshift function
N = datetime('today') W = dateshift(N, 'dayofweek', 'Wednesday') S = dateshift(N, 'dayofweek', 'Sunday') answer = min(W, S)

6 years ago | 0

Load more