Answered
Clickable list of all text-pattern functions?
Expand the "Match Patterns" section on this documentation page listing all the functions in the Characters and Strings category?...

4 years ago | 0

| accepted

Answered
Creating a daily date vector
Based on your stated goal, I'd probably store the data in a timetable array and then use retime to change it to a 'daily' timeta...

4 years ago | 1

| accepted

Answered
Index in Positon 1 is invalid
MATLAB indexing is 1-based not 0-based. The first element / row / column / etc. of an array in MATLAB is element / row / column...

4 years ago | 1

Answered
I would like my code to allow the user to plot as many circles as they want until the user right clicks, if the circle plotted intersects any other circle it must change color
% Define a function to make a "circle" with random center and radius % A 1000-sided polyshape is a pretty good approximation m...

4 years ago | 0

Answered
Implementation .m file into Appdesigner troubleshot
Which of those lines, line 55 or 56, throws the error? Set a breakpoint on that line. Then depending on which line throws the e...

4 years ago | 1

| accepted

Answered
i want to make program that find prime number
MATLAB already has a function for this. See the isprime function.

4 years ago | 1

Answered
Finding a node in graph with most mutually adjacent nodes
G = digraph(false(10)); G = addedge(G, 1, [2 4 5 7 9]); G = addedge(G, 2, [3 5 7 10]); G = addedge(G, 3, [1 2 4 8 9]); G = a...

4 years ago | 0

Answered
What version of MATLAB software will support ros2?
See this Answers post and the documentation page for the ros2 function in ROS Toolbox (which was Introduced in R2019b according ...

4 years ago | 1

Answered
getting int16s that are stored in two uint8s
Use typecast, potentially along with swapbytes. x = [0xbe 0xef] % Sample data class(x) % Two 8-bit unsigned integers y = type...

4 years ago | 1

| accepted

Answered
Issue with sprintf () latex interpreter
a = 1; disp('Here''s how to include a single quote in a char vector') disp("Here's how to include a single quote in a string a...

4 years ago | 1

| accepted

Answered
Termination tolerance in fsolve
See the Tip at the top of this documentation page. I suggest you increase your tolerance value to something greater than eps.

4 years ago | 0

| accepted

Answered
How to generate random numbers with constraint?
Generate the numbers then call sort on the array. By the way, you don't need to use a for loop here. The rand function can gene...

4 years ago | 0

Answered
Histogram occurences per class
Let's make some sample data and plot the histogram using the 'integers' BinMethod. In this case each integer in my data set gets...

4 years ago | 0

| accepted

Answered
time date to datenum and datenum to datetime
I'm going to assume that you've imported this data into MATLAB as a string array or a cellstr with two columns. Since I don't ha...

4 years ago | 1

Answered
What does it mean to take the absolute of an complex number? And why is it always positive?
I think one potential source of confusion is that the abs of this particular complex number looks an awful lot like its real par...

4 years ago | 1

| accepted

Answered
Error using matlab.internal.math.interp1 The sample points must be finite.
Error in coolprop_tab.MoistAir.calcMoistHeatCool (line 783) tOut(:,i) = interp1(x(:,i),v(:,i),xq(:,i)); Set a ...

4 years ago | 2

| accepted

Answered
Python function to Matlab
As @Anagha Mittal and @Akanksha Shrimal have stated there is a function in Financial Toolbox called movavg. However I'd recomme...

4 years ago | 0

Answered
Calculate the distance between points in a large data set
John showed you one approach. Two others that come to mind are to use the hypot or vecnorm functions. % Sample data xy = rand(...

4 years ago | 0

Answered
MATLAB gives the integer value of subtraction when the difference between numbers is large.
What's the distance from the elements of b to the next larger number? b = 10^23 distance = eps(b) If you were to add 1 to b, ...

4 years ago | 0

Answered
MATLAB function run in 2021a producing graphics handles as unique doubles (pre-2014 behavior) rather than handle objects
Without seeing what you're doing I'm only guessing, but I suspect you're preallocating an array as a double array and assigning ...

4 years ago | 2

| accepted

Answered
Split matrix into square cells
Use the histcounts2 function.

4 years ago | 2

Answered
How to publish as pdf from command tab
To do this using the publish function use the codeToEvaluate name-value pair argument as shown in the "Generate HTML View of MAT...

4 years ago | 1

| accepted

Answered
how to draw contour plot
There are a couple potential problems here. Did you really mean to make x a 1-element vector or did you mean to go from 0 to 1 i...

4 years ago | 1

Answered
Hi, do you know why I can't open the variable window by doule clicking any variables?
My suspicion is that you've written or downloaded a function with the same name as one of the functions included in MATLAB that ...

4 years ago | 1

Answered
To get x and y coordinates of the edges in a Delaunay Triangulation
Let's build a sample delaunayTriangulation using the first example on its documentation page. rng default; P = rand([30 2]); ...

4 years ago | 1

| accepted

Answered
Event in ode45 doesn't work
You don't want to use == in defining the first output of your event function. That will make the value of your event function 0 ...

4 years ago | 0

Answered
Create MException object with a custom non-empty stack (without actually throwing it)
Preallocate a cell array. M = cell(1, 3); Run the code that may throw an error. If it does, catch the error in the appropriate...

4 years ago | 0

Answered
Animated 3D Scatter Plot
Rather than recreating the scatter plot each time, I'd apply the first of the techniques listed on the Animation Techniques docu...

4 years ago | 1

Answered
Why this piece of code gives error?
Either make your CostFunction variable a function handle to the fun4sn0 function (which is the approach I'd prefer): CostFuncti...

4 years ago | 0

| accepted

Answered
ode return NaN :(
What is at time t = 0? By your formula 14 it is times other stuff. Let's ignore that other stuff and look at the value of that...

4 years ago | 1

Load more