Resuelto


Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

alrededor de 1 mes hace

Resuelto


Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

alrededor de 2 meses hace

Resuelto


frame of the matrix
Given the matrix M, return M without the external frame.

alrededor de 2 meses hace

Resuelto


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

alrededor de 2 meses hace

Resuelto


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

alrededor de 2 meses hace

Resuelto


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The values of B are in the same order a...

alrededor de 2 meses hace

Resuelto


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...

alrededor de 2 meses hace

Resuelto


Getting the indices from a matrix
Inspired by Problem 645. Getting the indices from a matrix. Given a matrix A (or a vector), return the indices (always in row...

alrededor de 2 meses hace

Resuelto


Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

alrededor de 2 meses hace

Resuelto


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

alrededor de 2 meses hace

Resuelto


Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

alrededor de 2 meses hace

Resuelto


Matrix with different incremental runs
Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

alrededor de 2 meses hace

Resuelto


Make an awesome ramp for a tiny motorcycle stuntman
Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

alrededor de 2 meses hace

Resuelto


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

alrededor de 2 meses hace

Resuelto


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

alrededor de 2 meses hace

Resuelto


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

alrededor de 2 meses hace

Resuelto


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to find the logical indices o...

alrededor de 2 meses hace

Resuelto


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

alrededor de 2 meses hace

Resuelto


String Logic 9
Examples: 'CAT' --> 'C' 'DOG' --> 'G' 'ROSLY' --> 'R' 'PROBLEM' --> 'M' 'TRUST' --> 'T' 'BASIC' --> 'C' 'GIANT' --> 'I'...

alrededor de 2 meses hace

Resuelto


String Logic 7
Examples: 'CAT' --> 84 'DOG' --> 79 'ROSY' --> 89 'MATLAB' --> 84 'TRUST' --> 85 'MOSTLY' --> 89

alrededor de 2 meses hace

Resuelto


String Logic 6
Examples: 'CAT' --> 216 'DOG' --> 218 'ROSY' --> 333 'MATLAB' --> 433 'TRUST' --> 418 'MOSTLY' --> 488

alrededor de 2 meses hace

Resuelto


String Logic 12
Examples: 'CAT' --> 'ACT' 'DOG' --> 'DGO' 'ROSY' --> 'ORSY' 'MOSTLY' --> 'LMOSTY'

alrededor de 2 meses hace

Resuelto


Estimating Monthly Electricity Cost for a Household Appliance
You recently bought an electric kettle for your kitchen, and you want to estimate how much it costs to run every month. The kett...

alrededor de 2 meses hace

Resuelto


Voltage Divider Calculation
A voltage divider is a simple circuit used to obtain a reduced voltage from a higher voltage source using two resistors in serie...

alrededor de 2 meses hace

Resuelto


Inductor Energy Storage Calculation
The energy (EEE) stored in an inductor is given by the formula: Where: E is the energy in joules (J) L is the inductance in...

alrededor de 2 meses hace

Resuelto


Calculate Charge Using Capacitance and Voltage
The charge (Q) stored in a capacitor is given by the formula:Q=C×V where: C is the capacitance (in farads) V is the voltage (...

alrededor de 2 meses hace

Resuelto


Calculate Current in a Series Circuit Using KVL
Kirchhoff's Voltage Law (KVL) states that the sum of voltages around a closed loop is zero. Given a voltage source (V) and three...

alrededor de 2 meses hace

Resuelto


Calculating the Total Resistance in a Series Circuit
Description: In a series circuit, the total resistance is the sum of the individual resistances. This problem asks you to write ...

alrededor de 2 meses hace

Resuelto


LED Current Calculation
In an electrical circuit, the current (III) flowing through an LED is determined using Ohm’s Law: ​​ Where: I is the current ...

alrededor de 2 meses hace

Resuelto


Ohm’s Law - Calculate Resistance
Ohm’s Law states that resistance R can be calculated as:R=V/I​ where: V is the voltage (in volts) I is the current (in ampere...

alrededor de 2 meses hace

Cargar más