Answered
Please how to give different color for each plot for this case
One way is to use rand. Colors here will be choosen randomly x = [-2:0.1:2]; a = [.5, 1, 1.3, 1.95]; figure; for i=1:length(...

4 years ago | 1

Solved


Pandigital number n°2 (Inspired by Project Euler 32)
After Problem 2319. An n-digit number is pandigital if it makes use of all the digits 1 to n exactly ONCE. For example, the 5-...

4 years ago

Answered
Add and subtract matrix element consecutively
What you are doing in a loop, can be done via element-wise multiplication as well. You can make an array for the corresponding ...

4 years ago | 0

Solved


Given two arrays, find the maximum overlap
Given two arrays s1 and s2, create a new array s3 which is as short as possible and contains both arrays. If s1 = [1 2 3 4 5]...

4 years ago

Solved


Apply Function to Each Field of a Structure Array: Part 2
The builtin <http://www.mathworks.com/help/matlab/ref/structfun.html?=structfun structfun> applies a function handle to each fie...

4 years ago

Solved


Apply Function to Each Field of a Structure Array: Part 1
The builtin <http://www.mathworks.com/help/matlab/ref/structfun.html?=structfun structfun> applies a function handle to each fie...

4 years ago

Solved


Identify Reachable Points
Given a vector of 2-D Points and a vector of 2-D Deltas create an array of all Locations that can be reached from the points usi...

4 years ago

Solved


Momentum Calculation
A shopping cart of mass 'm1' is traveling with velocity 'u' and collides with a second shopping cart of mass 'm2.' The two shopp...

4 years ago

Solved


Monty Python and the Holy Grail: Crossing the Bridge of Death
To cross the Bridge of Death, your function must return the numerical value for the airspeed velocity of an unladen swallow

4 years ago

Answered
How to determine outside perimeter of an array?
Note - a_perim vector doesn't correspond to the outer elements of a in the example you mentioned. Here's how you can achieve th...

4 years ago | 1

| accepted

Solved


Parcel Routing
Given a matrix that represent the distance along highways between major cities numbered 1 to _N_, provide the path and shortest ...

4 years ago

Solved


Length of shortest path in a directed graph.
Given a directed graph and a start and end node in the graph, return the minimum number of hops required to reach the end node f...

4 years ago

Solved


Draw a X
Given an input , create a square matrix of zeros with an X of ones. Ex. n = 3 drawX(3) [ 1 0 1 0 1 0 1 0 1 ] ...

4 years ago

Solved


Draw a triangle of ones
For any given n, return a matrix that includes a triangle of ones of height n: Example n = 3 output = [0,0,1,0,0 ...

4 years ago

Answered
How to get variable r recognised when inputting a matrice? eg matrix1 = [1, 0; 2/r, 1]
Use syms to make a symbolic variable (Note - It requires the symbolic math toolbox) syms r matrix1 = [1, 0; 2/r, 1] Or if you...

4 years ago | 1

| accepted

Solved


Create numeric palindromes and their square roots
Given a number n (1<=n<=9), return a left justified numeric matrix p with all the palindromes of the form 1 to n and back to 1. ...

4 years ago

Solved


Cyclotomic polynomial
Given a Natural number (N), return the corresponding Cyclotomic Polynomial.

4 years ago

Answered
How I can write in code for the Maximum value of 'Y' from left hand side not from right hand side in following figure?
Answering according to the image x=[1 2 3 4 5 6 7 8 9 10 11 12]; y=[3 4 3 2 1 2 3 4 5 6 5 4]; plot(x,y) locmax=islocalmax(y)...

4 years ago | 0

| accepted

Solved


Parametric Array
Create a row vector, 1xN (Integer, >1), such that the mean of the vector is M (Real number) and the standard deviation of the ...

4 years ago

Problem


Cyclotomic polynomial
Given a Natural number (N), return the corresponding Cyclotomic Polynomial.

4 years ago | 1 | 11 solvers

Problem


Parametric Array
Create a row vector, 1xN (Integer, >1), such that the mean of the vector is M (Real number) and the standard deviation of the ...

4 years ago | 1 | 9 solvers

Answered
Why am I not getting a colorcoded plot?
You are using plot3 to make your graph, in that case, you can not change the color of the points in line individually. Use scat...

4 years ago | 1

Solved


Longest Divisor Run
Given the vector a, find the longest run of consecutive numbers that can be evenly divided by the same number d where d > 1. ...

4 years ago

Answered
How do I plot a function with multiple outputs?
You are calling the function rwABRule incorrectly. Also, there's a spelling mistake in your function call. [VVectA3,VVectB3] ...

4 years ago | 1

| accepted

Solved


Consecutive Equation Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on the largest consecutive run of ...

4 years ago

Answered
Sorting return by dates
%to get the year of a date [year,~,~] = datevec(727594) %storing the years in y (months and dates are not necessary) %dates a...

4 years ago | 0

Answered
Find overlapping days across two datetime variables
%random data dt1=datetime(2022,6,1):datetime(2022,7,27); %1st June to Today dt2=datetime(2022,7,1):datetime(2022,9,1); %1st Ju...

4 years ago | 1

| accepted

Solved


Sleeping Queens 1
My youngest daughter received a card game named Sleeping Queens for Christmas this year, and has been playing it nearly non-stop...

4 years ago

Solved


Big numbers, repeated least significant digits
This problem builds off of <http://www.mathworks.com/matlabcentral/cody/problems/3077-big-numbers-least-significant-digits/ Prob...

4 years ago

Load more