Solved

Finding sum of even numbers in a vector.

Find the sum of all the even numbers present in the input vector x. Examples: Input x = [1 2 3 4] Output y is 6 Input...

1 month ago

Solved

Check Digit - 02

Given a list of ISBN's, check whether they're valid or not. Prev Prob - <https://www.mathworks.com/matlabcentral/cody/problem...

1 month ago

Problem

Check Digit - 02

Given a list of ISBN's, check whether they're valid or not. Prev Prob - <https://www.mathworks.com/matlabcentral/cody/problem...

1 month ago | 0

Solved

Count the non-zero elements along the diagonals that are immediately next to the main diagonal

Suppose, you are being told to write a matrix, *a* as input in MATLAB with having the possibility of containing zero and non-zer...

1 month ago

Solved

Check Digit - 01

The International Standard Book Number (ISBN) is a numeric commercial book identifier that is intended to be unique. It used ...

1 month ago

Problem

Check Digit - 01

The International Standard Book Number (ISBN) is a numeric commercial book identifier that is intended to be unique. It used ...

1 month ago | 0

Solved

How to add?

* Imagine you are in 2222 Anno Domini, when everyone must learn how to add, * and competing for the highly prestigious post of,...

1 month ago

Solved

Restricted Addition v3

This problem is <https://www.mathworks.com/matlabcentral/cody/problems/45258-restricted-addition-v2 Restricted Addition v2> with...

1 month ago

Solved

Restricted Addition v2

This problem is <https://www.mathworks.com/matlabcentral/cody/problems/45252 Restricted Addition v1> with more restrictions. Als...

1 month ago

Solved

Restricted Addition v1

Add two numbers without use of common arithmetic operations. Unfortunately, in order to enforce this restriction, other restrict...

1 month ago

Solved

Determine the perimeter of a three-quarter circle

If a circle has a diameter of x as an input value, then show the value of the perimeter of the three-quarter circle in output va...

1 month ago

Solved

Where do the maximum number belongs within a 3-D matrix?

Suppose, you are given two variables *a* and *b* as inputs in 2-D format. Find out, where do the maximum number belongs (as out...

1 month ago

Solved

Index one element in each vector of an array along a given dimension

Functions like min and max can return in their second output argument the index of the element in each vector along a particular...

1 month ago

Question

Find the elements of a ND matrix given the index of the elements

[b,idx]=min(a,[],2) -- gives the value as well as the index of the min value of each row of matrix a. Now the ques is - how to...

1 month ago | 1 answer | 0

Solved

Create logical matrix with a specific row and column sums

Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

1 month ago

Solved

Stairs

Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...

1 month ago

Solved

Problem for beginners

M is a nxm matrix. Swap the fist and the second last column with eachother. X=[1 2 3;4 5 6;7 8 9] Y=[2 1 3;5 4 6;8 7 9]

1 month ago

Solved

Problem for beginners

Suppose that x is a column vector, with at least a length of 6. Delete the 2., 6., and the second last row. Example: X=[1;2;3...

1 month ago

Solved

Inscribed circle in a triangle

A circle of radius r is inscribed in a triangle. In the figure, AC=x and BC=y. values of x & y are given. Find the ar...

1 month ago

Problem

Inscribed circle in a triangle

A circle of radius r is inscribed in a triangle. In the figure, AC=x and BC=y. values of x & y are given. Find the ar...

1 month ago | 0

Solved

Find the stride of the longest skip sequence

We define a _skip sequence_ as a regularly-spaced list of integers such as might be generated by MATLAB's <http://www.mathworks....

1 month ago

Solved

Sub-sequence - 03

Given three sequences, find the length of the longest common subsequence. It is similar to the previous problem -- <https...

1 month ago

Problem

Sub-sequence - 03

Given three sequences, find the length of the longest common subsequence. It is similar to the previous problem -- <https...

1 month ago | 1

Solved

Sub-sequence - 02

Given two sequences, find the length of the longest common subsequence. a=[1,1,1,1,1,2,3,1,4] b=[2,3,0,0,9,5,4,1] longe...

1 month ago

Problem

Sub-sequence - 02

Given two sequences, find the length of the longest common subsequence. a=[1,1,1,1,1,2,3,1,4] b=[2,3,0,0,9,5,4,1] longe...

1 month ago | 0

Solved

Sub-sequence - 01

Find the length of the longest increasing subsequence in the given array. a=[2,4,2,1,3,5,6] longest increasing subsequen...

1 month ago

Problem

Sub-sequence - 01

Find the length of the longest increasing subsequence in the given array. a=[2,4,2,1,3,5,6] longest increasing subsequen...

1 month ago | 0

Solved

Find the sum of all integers in a given matrix

Finding sum of all integers in a given matrix

2 months ago

Solved

Find the sum of all integers in a given matrix

Finding sum of all integers in a given matrix

2 months ago

Solved

Squares of odd numbers upto a given range

Find the squares of odd numbers upto a given range. If Given x=6 return y=(1^2,3^2,5^2) y=1,9,25 If Given x=5 retu...

2 months ago