A résolu

Is it the answer to life the universe and everything?
The answer to life the universe and everything is 42, but this is naturally in base 13. Unfortunately, MATLAB is in base 10, so ...

8 mois il y a

A résolu

Add Odd and Subtract Even Numbers in an Array
For an input array, add all the odd values and subtract the even values. The final value is the output. E.g. input = [1 2 3 4 ...

8 mois il y a

A résolu

Build the Well
Calculate the total time taken for building 'n' wells given : Worker A takes a hr to build the well alone Worker B takes b hr...

8 mois il y a

A résolu

Magnitude with vargin
Return the magnitude (square root of the sum of the squares) for an undefined number of input arguments.

8 mois il y a

A résolu

Determine if input is greater than pi
Evaluate if given number is greater than pi. If greater, return true; else, return false.

8 mois il y a

A résolu

Matrix symmetry
Given a matrix A = [1 2 3; 4 5 6] Flip it horizontally and vertically to obtain a complete reversal of both rows and columns. ...

8 mois il y a

A résolu

Bag of apples
find probabilty of getting red apples from a bag of 'r' red and 'g' green apples.

8 mois il y a

A résolu

convert 24 hour time to 12 hour time
convert 24 hour time to 12 hour time Input: '13:12' Output: '01:12 PM' Input: '06:12' Output: '06:12 AM'

8 mois il y a

A résolu

Find sum of alternate numbers in a vector
Find sum of alternate numbers in a vector starting from index 1

8 mois il y a

A résolu

Find cross product of 2 vectors
Find cross product of 2 vectors

8 mois il y a

A résolu

Find duplicate number from a vector of size n + 1 containing numbers from 1:n
From a given vector of size n + 1, return the duplicate number. Constraints The vector can only contain numbers from 1 to ...

8 mois il y a

A résolu

Even Sum
Calculate the sum of all even numbers between 1 and a given positive integer n. Write a function that takes n as input and retur...

8 mois il y a

A résolu

Draw the Greek letter 'α'
Given the dimensions of a matrix nRow and nCol where nCol > nRow, draw the Greek letter 'α' with 1's and 0's. You can consider t...

8 mois il y a

A résolu

Sum of Squares
Given a vector v of length n, write a MATLAB function to calculate the sum of the squares of its elements.

8 mois il y a

A résolu

String vowel manipulation
Given a string, find all the vowels and shift them to the end of the string in the same order as they are found.

8 mois il y a

A résolu

Cycle Detection
Detect if a graph has cycles: Inputs n: the number of vertices (where each vertex corresponds to an integer from 1 to n) edge...

8 mois il y a

A résolu

Sum the two halves of an array with an even number of elements
given an array of an even number of elements, sum the front and back half of the array and return the sums as an array For exam...

8 mois il y a

A résolu

Implement Euler's formula for calculating polyhedron edges
Your function will take as input the number of faces f and number of vertices v of a polyhedron. It will output the number of ed...

8 mois il y a

A résolu

Add Even and Subtract Odd Numbers in an Array
For an input array, add all the even values and subtract the odd values. This final value is the output. E.g. input = [1 2 3 4...

8 mois il y a

A résolu

findPositiveEvenNumbers
Write a MATLAB function findPositiveEvenNumbers that takes an array of integers as input and returns a new array containing only...

8 mois il y a

A résolu

How many revolutions around the earth
Calculate how many revolutions you will around the earth till 1/1/2100. Given the birhdate find your age in number of days on 1...

8 mois il y a

A résolu

Word with Highest Frequency
Write a MATLAB function that takes in a string and returns the word with the highest frequency in the string. The function shoul...

8 mois il y a

A résolu

Check for armstrong number
Given a number, check if it is an armstrong number. Eg: n = 371 Output: 1 Eg: n = 75 Output: 0

8 mois il y a

A résolu

Am I a city or a state
Input will be an array of cities and states. Also, lists of cities and states will be passed. Replace every city name with "cit...

8 mois il y a

A résolu

※本問は、2023/7/24開催の、筑波大学でのセミナーのために作成した問題です。 掃き出し法を使った連立一次方程式の解法を穴埋めで実装してみましょう。 左辺と右辺を、それぞれ以下の行列Aおよび列ベクトルBで表したものが与えられたとします。この時、...

8 mois il y a

A résolu

Convert row and column subscripts to linear indices
Convert 2D row and column subscripts to linear indices WITHOUT sub2ind Example: row = [1 2 3 1]; col = [2 2 2 3]; sz = [3 3]...

8 mois il y a

A résolu

Find collatz series next number
For given x, if x is even, output is (x/2) if x is odd, output is (3x+1)

8 mois il y a

A résolu

How many offices does MathWorks have in the UK
Please write a function that returns the number of offices MathWorks has in the UK.

8 mois il y a

A résolu

Calculate the sum of first x natural numbers
Calculate the sum of first x natural numbers for example if n=10 output =1+2+..+10=55

8 mois il y a

A résolu

2行2列の行列の行列式を求めてみよう
ある2行2列の行列の入力に対して、行列式を出力してください。 例えば、入力が(1,2; 3,4)のとき、出力は1*4-3*2で-2となります。

8 mois il y a