Answered
Convert a value into a Matlab syntax string
mat2str([1 0 0;0 1 0;0 0 1]) But if you're doing this so you can later on evaluate this text to define the variable, I would ad...

6 years ago | 1

Answered
Cannot find builtin function 'waitbar'
The builtin function is intended to call built-in functions, not functions implemented by MathWorks as function files with the ....

6 years ago | 0

| accepted

Answered
How can I mark specific indexes on a plot?
You could use the MarkerIndices property of the line object returned by plot or you could use xline depending on how you want th...

6 years ago | 0

Answered
Unrecognized method, property, or field 'vertices' for class 'triangulation'.
The stlread function's documentation page states it returns a triangulation object. The documentation page for triangulation ind...

6 years ago | 0

| accepted

Answered
Define a name of the variable using the value of other variable
M = repelem(["January"; "February"], 2, 1); D = [1; 7; 1; 3]; V = [100; 50; 400; 200]; T = table(M, D, V, 'VariableNames', ["...

6 years ago | 0

Answered
How to find is between values for 1min datetime delta
Your datetime array may not display the date data but it includes date data nonetheless. d = datetime('now') d2 = d; d2.Format...

6 years ago | 1

Answered
some meshgrid and matlab.chart.graphics errors
Q=[1 2 3;4 5 6;7 8 9]; S=[0;1;2]; u1=linspace(-10,10,20); u2=linspace(-10,10,20); u3=linspace(-10,10,20); [U1,U2,U3]=meshgr...

6 years ago | 0

Answered
How can I save a list of open m-files?
This wasn't an option when the question was asked originally, but you may want to create a Project to manage your files.

6 years ago | 0

Answered
Create a String Array
Like this? c = 'A':'E' s = string(c') M = s + (1:6)

6 years ago | 0

| accepted

Answered
Using sigma notation when index is included in fucntion
There's no need to use symsum here. The sum function will be sufficient. A = diag([1 2 4 8]) D = eig(A) s = sum(1./D) % The ....

6 years ago | 0

Answered
How can I access a field of a struct, if I have a cell-Array containing all the subfields?
data.car.speed = 10; data.car.color = 'white'; data.duration = 1000; data.format = 'A4' pathToField = {'car', 'speed'}; S =...

6 years ago | 1

| accepted

Answered
Error using odeset "Not Enough Input Arguments"
[t,Y] = ode45(@(t,X) rocket(t,X),tspan,ini,change); Based on the error message, change is a local function (a subfunction) insi...

6 years ago | 0

| accepted

Answered
How to calculate the mean/median/Standard deviation for each column in a table
Let's look at a sample table. load patients T = table(LastName, Smoker, Height, Weight, Systolic, Diastolic); head(T) It mak...

6 years ago | 2

| accepted

Answered
MATLAB Function Generates the Vertices of a Regular N-gon with Line Segments
You might find the degree-based trig functions sind and cosd useful. If you need to work exclusively with radians, the sinpi and...

6 years ago | 0

Answered
Why does pcolor require you to transpose the matrix when you give it x and y vectors?
Suppose you have an M by N matrix of data called A. Associated with that data is a vector in the x-direction with length M and a...

6 years ago | 0

Answered
Variable not being saved/stored from function
function [ZWF,XWF,ZRF,XRF] = walk_run(n) Your function declaration does not list XWI as a variable that it returns to its calle...

6 years ago | 0

Answered
Why does pcolor not display the full matrix?
This is not a bug. The perceived bug is the result of the 2-dimensional fencepost error. From the description of the C input arg...

6 years ago | 1

Answered
How to show every iteration step of lsqnonlin()?
You probably want to specify a PlotFcn as part of the options that get passed into lsqnonlin. See this documentation page for mo...

6 years ago | 0

Answered
matlab error ode45
If you call your rolling function with the first element of tspan and the initial condition vector x0 as inputs, do you receive ...

6 years ago | 1

Answered
Linspace giving me undefined function 'uminus'
Here's what appears to be the relevant section of code. b = app.RadiusStalk; E = app.ElasticModulus; ...

6 years ago | 0

| accepted

Answered
Cannot get the function to draw function
% t1 = 0: 1/10000 : 5; % funkce1 = exp(-3*t)-2; Is funkce1 supposed to use t or t1? I could see it using the symbolic variable...

6 years ago | 0

Answered
Changing version of Python in MATLAB
See the "Set Python Version on Mac and Linux Platforms" section on this documentation page.

6 years ago | 1

Answered
Syms function no longer works in a for loop which stores data
If you try to do something like the following: %{ syms x F = 0; F(2) = x; %} What numeric value should be stored in F(2) a...

6 years ago | 0

Answered
Getting Error message when using backslash operator
You've posted the dydtsys_practice function that implements the right-hand side of your system of ODEs, but to solve the system ...

6 years ago | 0

| accepted

Answered
How to find the index of a randomly chosen element of an array
Start off generating the index and use it to extract the element. a = [4 8 15 16 23 42]; I = randi(numel(a)); fprintf("Elemen...

6 years ago | 2

Answered
Timestamp to Decimal day of year
dt = datetime('now', 'TimeZone', 'EST') startOfYear = dateshift(dt, 'start', 'year') fractionOfYear = years(dt - startOfYear) ...

6 years ago | 0

Answered
Imagine a dice tetra-brick (four faces: 1, 2, 3, 4) with the following probabilities [0.5, 0.2, 0.2, 0.1] . Let Y be the Random Variable that simulate the output of rolling the dice.
Use histcounts or histogram. Alternately if this is part of a homework assignment and you're instructed not to use those functi...

6 years ago | 0

Answered
How can I define the variable handles for this code. A is a numerical value not text "Undefined variable handles or class "handles.A"
Generally speaking, usually code that involves a struct array named handles is part of a GUI created using GUIDE. If you're tryi...

6 years ago | 0

Answered
Simple, but stumped. Using 'xline' to create animated "play marker" across waveform plot.
Rather than deleting and recreating the line, change its properties. % Define the data x = 0:360; y = sind(x); % Create th...

6 years ago | 1

Answered
The fix(x) command does not work
Just because a number is displayed as 1 in the default display format does not mean that the stored value is exactly 1. It's clo...

6 years ago | 0

Load more