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

5 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...

5 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...

5 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...

5 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...

5 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...

5 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 ...

5 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; ...

5 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...

5 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.

5 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...

5 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 ...

5 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...

5 years ago | 2

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

5 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...

5 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...

5 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...

5 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...

5 years ago | 0

Answered
How to replace all newline characters in a string with a space?
Since this sounds like it may be a homework assignment, I'll only give a hint. There's one function in the "Create, Concatenate,...

5 years ago | 0

Answered
Checking if a value is equal to zero or no ? with the problem of floating-point numbers !
Testing for exact, down-to-the-last-bit equality with == can be problematic. Instead, the general recommendation is to check for...

5 years ago | 0

Answered
Help With Conditonally variant Anonymous function.
Let's say val is 2. So if Z is between 1 and 500 B2 should be -2, if it is between 501 and 1500 B2 should be 2, and if it is bet...

5 years ago | 0

Answered
How do I call a function which I have defined within a class?
When you call a non-Static method of a class, at least one of the inputs to that method must be an instance of that class. With ...

5 years ago | 1

Answered
Different results with same code??
m_s = 2000; %(kg) Sprung mass m_u = 200; %(kg) Un-sprung mass k_s = 200000...

5 years ago | 0

Answered
Creating M histograms from an NxM table on separate plots
A = 2*randn(1e4, 6) + 5*(0:5); T = array2table(A); for k = 1:width(T) subplot(2, 3, k) histogram(T{:, k}) end Note...

5 years ago | 1

| accepted

Answered
Operands on table, comparison with numbers
say I fix one of the row indices " ind" .If I try say find(A(ind,:)>0.1) I get the error : "Operation '>' not supported for oper...

5 years ago | 0

| accepted

Answered
How to extract rows based on column values in a matrix?
This wasn't an option when the question was asked originally but depending what you're trying to do with those "3 matrices", usi...

5 years ago | 0

Answered
Matlab 2020b does not find Xcode Mac OS Big Sur
I would try following the instruction in the warning message. Run Xcode (outside of MATLAB) and when it prompts you to accept th...

5 years ago | 0

Answered
Create new column in table based on another column value
Let's start with a sample table. T = table([123; 345; 234], [9; 1; 3], 'VariableNames', ["ID", "Occurrences"]) Fill in the Uni...

5 years ago | 1

| accepted

Answered
Sorting time in 1 hour time slots.
minutesPerDay = minutes(days(1)); m = minutes(randi(minutesPerDay, 100, 1)); n = datetime('now'); t = n + m; h = histogram(t...

5 years ago | 0

Answered
Generalized Eigenvalue Problem - Hessenberg Matrix
It sounds like you might want to use the syntax of eigs whose first input is Afun, a function handle that returns the result of ...

5 years ago | 0

Load more