A résolu


Calculating the total earnings of a factory
The row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values ...

3 mois il y a

A résolu


Generate the Matrix!
Given n, generate the following matrix: a = [ n n-1 n-2 ... 2 1; n-1 n-1 n-2 ... 2 1; n-2 n-2 n-2 ... 2 1;...

3 mois il y a

A résolu


count upper and lower case characters
In a given input string, count and return the number of upper and lower case characters as u and l respectively. For example:...

3 mois il y a

A résolu


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 = 9 + 16 ...

3 mois il y a

A résolu


Dial Up
Each number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list: 2 ABC, 3 DEF...

3 mois il y a

A résolu


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

3 mois il y a

A résolu


The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

3 mois il y a

A résolu


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

3 mois il y a

A résolu


surface areas of a cylinder
There are 3 inputs: option, radius and height. If option= '1', compute the lateral surface area of the cylinder, for option 2 ca...

3 mois il y a

A résolu


Repetition of matrices
*A is a bold matrix: [1 2 3; 4 5 6;7 8 9]* Given an integer 'n' , a matrix B exists such that has n copies of A in the row an...

3 mois il y a

A résolu


Joules to Megatons of TnT
Given joules, J, make a function that converts to megatons of TNT.

3 mois il y a

A résolu


MPS to MPH
Given the speed in miles per second, find the speed in miles per hour.

3 mois il y a

A résolu


Degrees to Radian
Convert degrees to radians

3 mois il y a

A résolu


Hydrostatic Pressure
Given depth(height), in m, find the pressure under a body of water. Need to know the density of water(kg/m^3), and gravity(m/s^2...

3 mois il y a

A résolu


Values in Array
How many values are in the array

3 mois il y a

A résolu


Energy of an object
Calculate the total mechanical energy of an object. Total Energy= Potential energy + Kinetic energy P.E.=m*g*h K.E.=1/2...

3 mois il y a

A résolu


Sum of cubes
Write a program to determine sum of cubes of first n odd numbers.

3 mois il y a

A résolu


Create a constant offset.
Add a constant offset to an array. Example a = [1 3 5 9] offset = 2 y = [3 5 7 11]

3 mois il y a

A résolu


Nth root
Nth root of a number x

3 mois il y a

A résolu


Delete x value in given vector y.
Delete x value in given vector y. Exapmle x=5; y=[ 1 2 5 6 74 5 2 5] result=[1 2 6 74 2]

3 mois il y a

A résolu


Calculate solution of given polynomial
For example, y=function([3 -2 -4]) In here, input vector indicate 3*x^2-2*x-4, y is solution of former equation. y=[1.5...

3 mois il y a

A résolu


Calculate numerical integration.
x=0:0.01:1 y=@(x)x.^2 Using given two inputs(x and y), conduct numerical integration in x. (hint: trapz)

3 mois il y a

A résolu


Calculate correlation.
There are two data. y1=[0 1 2 3 4]' y2=[2 3 4 5 6]' We can see positive relationship between y1 and y2. The relations...

3 mois il y a

A résolu


Save variables
a=[1] Save variable a that is located in workspace into current folder. File name should be 'a.mat'

3 mois il y a

A résolu


Change matrix to vector2
From x = 4 3 5 1 5 1 To y = 4 3 5 1 ...

3 mois il y a

A résolu


Where is 1?
There is a 3d matrix [A] that consist of many zeros and only one. A=zeros(100,100,100); i=randi(100); j=randi(100); k=randi(...

3 mois il y a

A résolu


Solve the system of linear equations
4x - 2y +6z=8 2x + 8y +2z=4 6x + 10y +3z=0 Input is each coefficient of polynomial. For example, a=[4 ...

3 mois il y a

A résolu


Upper triangular matrix
Create a function to retrieve the upper triangular matrix of a matrix (without using tril). The matrix will always be square. ...

3 mois il y a

A résolu


Extract a specific part of matrix!
In the given matrix, extract element that have odd rows and column number. For example A=[1 4 2 3 5] B=extractodd(A);...

3 mois il y a

A résolu


Kinetic Energy
Given mass, m, and kinetic energy, KE, find the velocity of the object.

3 mois il y a

Charger plus