Answered
'Dot indexing not supported' error shows up only when running executable
Let me guess, you're calling load to load the LinearModel object from a MAT-file. Please see the Tip in the "Fixing Callback Pro...

4 years ago | 1

| accepted

Answered
How can I plot the profile/skyline of an histogram from histcounts?
If you have to go through histcounts first: X = normrnd(3,10,[1,1000]); [values, edges] = histcounts(X,100); h = histogram('B...

4 years ago | 0

| accepted

Answered
Combining two datetime columns into one
Why is your Time data stored as a datetime array? IMO it would make more sense for you to import or create it as a duration arra...

4 years ago | 0

Answered
I HAVE A VECTOR AND I NEED TO INSERT 2 ZEROS BETWEEN EACH ELEMENT FROM THE ORIGINAL VECTOR.
Calculate how long the final vector should be with those 0's added in. Determine the indices in that final vector where the ele...

4 years ago | 0

Answered
What does the red lock icon mark mean?
If you're using the Workspace browser as part of debugging a class method, according to the "View Variable Contents" section on ...

4 years ago | 0

| accepted

Answered
Plot occurrences of values with bin edges, by using "histcounts" and "plot" functions
Why not just use histogram? X = normrnd(3,10,[1,1000]); h = histogram(X, 100); c = h.BinCounts; e = h.BinEdges; for whichBi...

4 years ago | 0

| accepted

Answered
Tolerance use in verifyEqual for unit tests
testCase = matlab.unittest.TestCase.forInteractiveUse; verifyEqual(testCase, 0.3589, 0.3588, "AbsTol", 0.0001) Can you show us...

4 years ago | 0

| accepted

Answered
Extract the last day of each month in daily data set
Let's look at a three month data set. dates = (datetime(2022, 01, 01):datetime(2022, 03, 31)).'; data = randperm(numel(dates))...

4 years ago | 0

Answered
How does the code "load data" produce P and T in Genetic Algorithm?
Because that's the size of the P variable stored in the data file named data.mat. If you're asking where that variable came from...

4 years ago | 1

| accepted

Answered
Functions are not defined in physics informed neural network documentation
According to the Release Notes this example was added to Deep Learning Toolbox in release R2021a. You will need to upgrade to th...

4 years ago | 0

Answered
How to evaluate the union area of the multiple circles plotted in matrix form of centers and radii?
A different approach, one that doesn't involve cell arrays or cellfun: center = randi(10, 6, 2); % 6 circle centers radius = r...

4 years ago | 1

Answered
Unfamiliar .D0 number syntax
This is E notation. I believe MATLAB supports D as well as E because Cleve was inspired by Fortran, which as a comment on that p...

4 years ago | 1

| accepted

Answered
Getting variables in function workspace during debugging
I'm creating a mlapp data visualization tool and need to grab all variables in the current function workspace when debugging. ...

4 years ago | 0

Answered
Loop through anonymous function
As written the body of your anonymous function is completely independent of X1 and z. I suspect that vector and/or vector1 are ...

4 years ago | 0

Answered
Why do I get the error saying I did not assign values to a call? I did assign my values after getting them from a function though? Anyone able to help me out and explain?
You've defined your atmos function to return the value of its local variable P as the second output. What value should be retur...

4 years ago | 0

| accepted

Answered
How do I stop the code and get the results?
If you're out of time and need to get the results that have been computed, under certain circumstances (the main ones being the ...

4 years ago | 1

Answered
Create new variable from an existing variable but deleting some outliers
Remove all rows in the table that have an outlier value for the oxy variable. Here's a similar example using the sample patients...

4 years ago | 1

Answered
Query logarithmic axis properties
h = semilogx(1:10, 1:10); ax = ancestor(h, 'axes') Now query or change the properties of the axes whose handle is ax.

4 years ago | 0

Answered
Can't find show() function
Can you confirm that your planner variable is a plannerHybridAStar object? What does this code display? isa(planner, 'plannerHy...

4 years ago | 0

Answered
Finding out the size of x (so how many xi we have) in a function handle
If you're doing this so you can dynamically generate the body of f that computes the sum of the squares of the elements of the i...

4 years ago | 1

Answered
Converting Numeric Dates in Matlab does not work
Another way to do this is to convery the serial date number to a datetime using the 'ConvertFrom' name-value pair argument. x =...

4 years ago | 1

Answered
find mode of an array but if there is no mode then return a random number
Use the third output from a call to mode. If that third output is not a cell containing a scalar the mode is not unique and ther...

4 years ago | 1

| accepted

Answered
Does the execution of addpath/rmpath/savepath in one workspace affect other workspaces?
IMO the only test that probably should be calling savepath is the test for the savepath function itself. You shouldn't be writin...

4 years ago | 3

Answered
I need a function to go to a table in the workspace and return a table with specfic values from a specfic colmun.
Don't pass the name of the table into your function and ask it to go searching in its caller's workspace for it. Pass the table ...

4 years ago | 1

| accepted

Answered
What is sigma function?
From Wikipedia: "In general mathematics, uppercase Σ is used as an operator for summation." In MATLAB see the sum function. I'm...

4 years ago | 0

Answered
Loop to get mean and max of multiple variable arrays
Can you define variables with numbered names like car1, car2, car3, ... ? Yes. Should you do this? Generally we recommend again...

4 years ago | 0

Answered
Implementing ellipsis, also known as dot dot dot or "..." for line continuation in a regular expression statement
Instead of trying to split a long char vector across multiple lines, why not write your regular expression as a series of string...

4 years ago | 0

| accepted

Answered
Undefined function 'abc' for input arguments of type 'double'.
The way you've defined your method, one or both of the inputs obj and n to your method must be an instance of the class. You're ...

4 years ago | 0

Answered
Is there a way to search for function calls recursively without running the program?
Static analysis can only get you so far. What function gets called by these two lines of code (omitting the block comment lines)...

4 years ago | 1

Answered
duration to number(double)
Use seconds, hours, etc. depending on how you want the duration array to be converted to a number. d = duration(1, 2, 3) s = s...

4 years ago | 3

| accepted

Load more