Answered
why it does not go to if statement and not only in else?(variable 'omega' might be set by a nonscalar operator)
From the documentation page for the if keyword: "if expression, statements, end evaluates an expression, and executes a group of...

4 years ago | 0

Answered
how to floor time for each hour?
If you want to actually modify the data rather than just changing how the data is displayed you can use dateshift. tv = {'12-De...

4 years ago | 2

Answered
Variable 'max_V' is not fully defined on some execution paths.
The variable max_v (line 9) with a lower-case v is not the same as the variable max_V (lines 1, 13, and 16) with an upper-case V...

4 years ago | 1

Answered
Finding function calls in my code using the Profiler
Click on the name of the function. It's a link that will bring up the page for that function. I'm not 100% sure if property acce...

4 years ago | 0

| accepted

Answered
ismembertol: What am I doing wrong?
Based on your comment describing the problem you're trying to solve: "The idea is to make the elements that fall outside a rang...

4 years ago | 1

| accepted

Answered
Mathworks: it's time for a dark theme.
As of release R2022a you can select a dark or light theme in MATLAB Online. See the Release Notes for more information. Note: t...

4 years ago | 4

Answered
How to generate pattern randomly In MATLAB
So to clarify you have a vector of y values: y = [1 2 3]; that you want to repeat over and over to give a pattern like: yy = ...

4 years ago | 0

Answered
List of New / Updated Functions per MATLAB Version
For functions added in a release you could search for "Introduced In" followed by the release number and get a close approximati...

4 years ago | 1

| accepted

Answered
Normalize x-axis and y-axis of surface plot
Call surf with 3 inputs not just 1. [x, y, z] = peaks; figure surf(z) title('1 input') figure surf(x, y, z) title('3 inpu...

4 years ago | 0

| accepted

Answered
Comparison of very large numbers
What do you think the exact value of your variable is? x = 1.056375500190191e+29; y = x + 1e6; x == y % true and this is the...

4 years ago | 1

| accepted

Answered
Error that does not make sense.
At first I thought you might be running into the common non-scalar if condition problem. From the documentation of the if keywor...

4 years ago | 0

Answered
pcolor() default EdgeColor or EdgeAlpha
x=1:200; y=1:100; [X, Y] = meshgrid(x, y); dummyData = (sqrt(X.^2 + Y.^2)); area = 2; distance = 100; nexttile p1=p...

4 years ago | 1

| accepted

Answered
how mark the highest maximums of a graph?
Let's plot some sample data. x = 0:360; y = sind(x).*(x-60).*(x-180).*(x-210)/(360.^2); plot(x, y) hold on Identify the loc...

4 years ago | 0

| accepted

Answered
How can I re-create sparse matrixes from the row and column indexes, and values?
Let's take a simple example: rng default S = sprand(10, 10, 0.1); % 10-by-10 with roughly 10 nonzero elements Let's get the v...

4 years ago | 1

| accepted

Answered
can't solve heat transfer in shell and tube by using ode45
You've only shown us 7 lines from onepass.m and I suspect that the lines you've shown start somewhere after the beginning of the...

4 years ago | 0

Answered
Seeking a Simulink Tutor/Coach
FYI MathWorks offers both training courses and consulting services.

4 years ago | 0

Answered
Histogram shows one value at the very end that ruins the plot
If that last bin is (roughly) twice as high as you think it should be, that's because the last bin includes both values that mat...

4 years ago | 0

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

Load more