Answered
How do you initialize an N*M matrix with certain N*1 vector?
You can use repmat() signal=zeros(5,4); vectorA=[1 2 3 4]; for k=1:5 signal(k,:)=vectorA; end signal y=repmat(vectorA,5,1...

3 years ago | 0

| accepted

Solved


Compute the area of the shoemaker’s knife
A shape resembling a shoemaker’s knife is constructed from a semicircle with diameter with two semicircular “bites” of diameter...

3 years ago

Solved


Repeatitive Summation
Given numeric vectors x, a and b, perform the following operation - a represents a vector of numbers and b represents a vector ...

3 years ago

Solved


Dealfun (1.0)
*Short description.* Write a function _dealfun_: [y1,y2,...,yn]=dealfun(fhandle,x1,x2,...,xn) which evaluates the f...

3 years ago

Solved


Convert a number to its Roman representation
Convert a given number to its Roman representation. For example, if the number is 98, it should display 'XCVIII'

3 years ago

Solved


Math with Roman Numerals
Given a function R within (+,-,*,/) and two Roman numerals a & b, compute aRb in Roman numerals.

3 years ago

Solved


Convert Roman to Arabic Numerals
Based upon what I see on tv and at the movies, the use of Roman numerals indicates something is important or sophisticated (e.g....

3 years ago

Solved


Area-07
This is a follow up of the problem <https://www.mathworks.com/matlabcentral/cody/problems/45341-area-06> in this case, fi...

3 years ago

Solved


Area-03
There are two circles of equal size are inscribed inside a square. They are tangent to each other. <https://serving.photos.ph...

3 years ago

Problem


Repeatitive Summation
Given numeric vectors x, a and b, perform the following operation - a represents a vector of numbers and b represents a vector ...

3 years ago | 2 | 10 solvers

Answered
How to replace all for-loops ?
That would be something like this - e1=vector; e2=twofor; %comparing results from both methods result_comparison=isequal(e...

3 years ago | 1

| accepted

Answered
How to calculate distance between a set of point to multiple point
setA = [2,1; 2,3; 4,6]; setB = [8,8; 9,8; 3,7; 5,8; 9,2; 3,4; 5,7]; %single element dist=vecnorm(setB-setA(1,:),2,2) %for ...

3 years ago | 1

| accepted

Solved


Where's Waldo?
Find the string 'Waldo' in the character matrix given and return the indices of where you found him as a 4x2 matrix where the el...

3 years ago

Solved


Leave a thumb-up to pass
Just leave a Like, and a comment if you wish. Then wait, and submit.

3 years ago

Solved


Find and replace the zero array in a matrix
Find the zero array in the matrix and replace it with average of surrounding (adjacent) arrays. Example: A = 3 5 ...

3 years ago

Answered
I WANT TO CREATE MATRIX COMBINATION
A = [1 2 3]; B = [4 5 6]; nA=numel(A); nB=numel(B); %If you have Stats and ML Toolbox y=fullfact([nA nB]); C=[A(y(:,2));B(...

3 years ago | 1

Answered
Matrix index summation with repeated index
A = [1;2;3;4]; A_add = [1;2;3]; i = [1;2;1]; %unique index idx=unique(i) %corresponding sum add=accumarray(i,A_add) %fi...

3 years ago | 1

Answered
How to plot stacked bar with single bar under the same category
%sample data x=[1 1.5 nan 3 3.5 nan 5 5.5]; y=[5 nan nan; nan 4 2; nan nan nan; 7 nan nan; nan 3 3; nan nan nan; 6 nan nan; na...

3 years ago | 0

| accepted

Answered
Several line plot (2D) with colormap (including labelling)
x=[1,3,5,1,3,5;2,4,6,2,4,6]; y=[1,1,1,-1,-1,-1;1,1,1,-1,-1,-1]; z=[3.1,2.2,4.8,1.6,2.9,3.7]; %defining colormap map=[255 0 0...

3 years ago | 2

| accepted

Solved


Locate image wells
A mathematical model of wells pumping groundwater near a boundary can be constructed using the method of images, which is also u...

3 years ago

Solved


yet another flying fly (YAFF)
Same as the previous problem <http://www.mathworks.com/matlabcentral/cody/problems/203-fly-fly-away fly fly away> but now with *...

3 years ago

Solved


Sort an array of structures
You need to sort an array of structures based upon *a numeric first field*: For example : a.n=1; a.name='a'; b.n=3...

3 years ago

Solved


Determine if input is a Harshad number
In mathematics a harshad number (or Niven number) in a given number base is an integer that is divisible by the sum of its digit...

3 years ago

Solved


2D Indexes
Given in input the maximum degree P, the algorithm furnishes a ordered list of two dimensional vectors [i,j] i,j>=0 such that i+...

3 years ago

Solved


Jump Search - 01
Find the number of leaps you need to take to find an element in an array using the jump search algorithm. For example, a=[ 2,...

3 years ago

Solved


FloydWarshall
Our task is to find shortest paths between every pair of nodes. Floyd-Warshall is a graph algorithm for finding shortest paths i...

3 years ago

Solved


Calculate the dynamic time warping similarity
Dynamic time warping (DTW) is an algorithm for measuring the similarity between two time series that may have been acquired at d...

3 years ago

Answered
what's "error: x(7): out of bound 1 (dimensions are 1x1)"?
Use another letter/symbol for the function handle input variable, as x has already been defined as an array - % Define the data...

3 years ago | 1

| accepted

Solved


Determine if given number is perfect
A number is <http://en.wikipedia.org/wiki/Perfect_number perfect> if it is equal to the sum of its factors, excluding itself. ...

3 years ago

Answered
Cody: where's the Modeling and Simulation Challenge group?
Hi Christian, that particular group is not available on Cody anymore as the support for Simulink on Cody has been removed or res...

3 years ago | 3

| accepted

Load more