Answered
How to generate random graph of n vertices with random connections in matlab
Take a look at the sprand and sprandsym functions.

5 years ago | 0

Answered
how to integrate a product with function handle
You can't calculate the product of a number and a function handle. What you can do instead is calculate the product of a number ...

5 years ago | 0

Answered
Creating a new column in a table which is true or false
rng default id = (1:10).'; SIC = randi(3, 10, 1); t = table(id, SIC) t.is1or2 = ismember(t.SIC, [1 2])

5 years ago | 0

| accepted

Answered
Getting the error as "Undefined function or method 'syms' for input arguments of type 'char'" when trying to use syms
You likely don't have Symbolic Math Toolbox installed and licensed. Check the output of the ver function to see if it's installe...

5 years ago | 0

Answered
How to know the value of a variable in a past time in Simulink?
I think you want a Unit Delay block.

5 years ago | 0

| accepted

Answered
index in safe-title
Try: str = "title_" + t{n} saveas(gcf,str,'jpeg') This will attempt to convert t{n} into a string and concatenate the string ...

5 years ago | 0

| accepted

Answered
Where can I find the dijkstraShortestPaths() function?
We do not distribute the source code for that function. What type of modification were you hoping to perform on that function? ...

5 years ago | 0

| accepted

Answered
Vector sum of forces
Use the vecnorm function.

5 years ago | 0

Answered
Error using sub2ind Out of range subscript how to solve this?
What's the index of the value in row 1, column 6 of a 4-by-5 matrix? sub2ind([4 5], 1, 6) Trick question, since a 4-by-5 matri...

5 years ago | 0

Answered
why is the variable order in a user defined function important in lsqnonlin optimisation?
Why does the order in the self defined function important for lsqnonlin fitting? For the same reason that trying to feed yourse...

5 years ago | 0

| accepted

Answered
Is there any maximum for the size of matlab table?
There are theoretical limits (based on limitations of the operating system's ability to address memory) that you are highly unli...

5 years ago | 0

Answered
Linearly detrended and a 30-day running mean
See the detrend and movmean functions.

5 years ago | 0

| accepted

Answered
Equation Error Argument to dynamic structure reference must evaluate to a valid field name
The number 1 is not a valid struct array field name. S = struct('a', 1, 'b', 2) S.('c') = 42 % works S.(1) = -99 % does not w...

5 years ago | 0

| accepted

Answered
How to plot time format
Now you'd probably want to use a duration array. h = randi(3, 1, 10); m = randi([0 59], 1, 10); s = randi([0 59], 1, 10); D ...

5 years ago | 0

Answered
How to call a private function in a static function in App Designer?
Nowhere in your static method have you defined the variable app. methods ( Static ) function xd = anaerob(~...

5 years ago | 0

| accepted

Answered
Interactive with graphics in GUI
ax = axes('ButtonDownFcn', @(varargin) disp('hi')); Click on the axes. MATLAB will display hi in the Command Window. Now add a...

5 years ago | 0

| accepted

Answered
Error while finding determinant
Do you by any chance have a variable named det in your workspace? If so you will not be able to call the det function until that...

5 years ago | 1

Answered
Open Matlab editor while running from command line
We stopped shipping the standalone editor quite some time ago, long enough that I can't find it in the Release Notes. It's proba...

5 years ago | 0

Answered
Anyone know why it isnt accepting my expression
You're missing two multiplication signs. This is not valid MATLAB code. 2(w+vk) You need 2*(w+vk)

5 years ago | 0

| accepted

Answered
How to use DATE Excel Function in Matlab vector calculations?
Don't work with serial date numbers unless you absolutely have to. Use a datetime array instead. dt = datetime('now') + hours(r...

5 years ago | 0

| accepted

Answered
Range of matrices?
Tsigma(k)= [c^2 s^2 2*c*s;... s^2 c^2 -2*c*s;... -c*s c*s c^2-s^2]; What's on the...

5 years ago | 0

| accepted

Answered
Match different time series with one date vector
Consider storing your time-based data as timetable arrays and use synchronize to synchronize the timetables to a specific date a...

5 years ago | 0

| accepted

Answered
How to tell solver that symbols are matrices
If you're using release R2021a or later and have Symbolic Math Toolbox, create a symbolic matrix variable using the syms or symm...

5 years ago | 0

| accepted

Answered
Is it possible to generate specific random numbers?
Sure. seedvalue = 0; expected = [89 70 10 12 67 25 200 18 90 86]; rng(seedvalue, 'twister'); actual = randperm(max(expected)...

5 years ago | 0

| accepted

Answered
Best Matlab Editor replacement?
a better list of functions that is permanently visible and can be sorted and clicked, bookmarks, etc... In the Navigate section...

5 years ago | 1

Answered
Need to run two counters in a foor loop
F = 3; S = 4; for first = 1:F fprintf("Counting up, first is %d\n", first) for second = S:-1:1 fprintf("Cou...

5 years ago | 0

Answered
Assign value to variables
Can you define variables with numbered names like X1, X2, X3, ... ? Yes. Should you do this? Generally we recommend against it....

5 years ago | 0

Answered
Error with function handle while running Genetic Algorithm code
According to the documentation for the ga function you could be trying to call one of these syntaxes (ignoring the number of our...

5 years ago | 1

Answered
Why do logical operators do not work with the eigenvalues of this matrix?
The eigenvalue is not exactly equal to 1. It is close enough to 1 that it is displayed as 1 in the default display format. You ...

5 years ago | 0

Answered
Error using ' (line 214) Undefined function 'ctranspose' for input arguments of type 'table'. Use the ROWS2VARS function instead.
Your variable data, being created by readtable, is a table. So are the variables like MktRF_star that you create by extracting o...

5 years ago | 0

| accepted

Load more