A résolu


find the value

environ 4 ans il y a

A résolu


Times 5
Try out this test problem first. Given the variable x as your input, multiply it by five and put the result in y. Examples...

environ 4 ans il y a

A résolu


Percentage
There is x liter water and y gram => z is percentage of salt in water

environ 4 ans il y a

A résolu


Average of corner elements of a matrix (★★)
(copy of prob 2235) Calculate the average of corner elements of a matrix. e.g. x=[1 2 3; 4 5 6; 7 8 9;] avg = (1+3+7+9)...

environ 4 ans il y a

A résolu


Mile to Kilometer
x is mile and y is km

environ 4 ans il y a

A résolu


Times 10
Try out this test problem first. Given the variable x as your input, multiply it by ten and put the result in y. Examples:...

environ 4 ans il y a

A résolu


GPA
Math's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA

environ 4 ans il y a

A résolu


Create a vector of the first n odd numbers (★)
If n = 10, your program should return a vector y, where y = [1 3 5 7 9 11 13 15 17 19].

environ 4 ans il y a

A résolu


Volume of Cylinder
Find the volume of a cylinder

environ 4 ans il y a

A résolu


Generate a vector which contains a pyramid pattern (★★★★)
Generate a vector that contains terms that follows a pyramid pattern up to the nth row: 1 2 2 3 3 3 4 4 4 4 ...

environ 4 ans il y a

A résolu


Create a vector of the first n natural numbers (★)
If n = 7, your program should return a vector y, where y = [1 2 3 4 5 6 7].

environ 4 ans il y a

A résolu


Select every other element of a vector (★★)
(copy of prob 6) Write a function which returns every other element of the vector passed in. That is, it returns the all odd-...

environ 4 ans il y a

A résolu


Vector of digits (★★)
Given a positive integer x, construct a vector y with all the digits of x in the order of appearance in x. Thus, if x = 172...

environ 4 ans il y a

A résolu


Create times-tables (★★★)
(copy of prob 33) At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 ti...

environ 4 ans il y a

A résolu


Replicate elements in vectors (★★★)
(copy of Prob 867) Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2...

environ 4 ans il y a

A résolu


Function 1 (★)
Compute the value of <<https://i.imgur.com/AxKWLmE.gif>> for any given positive x.

environ 4 ans il y a

A résolu


Sum of elements of a vector (★★★)
Given any vector x = [x1, x2, x3, ... xn], compute the sum of its elements. Thus, if x = [ 1 3 -2 5 ], then the sum of its el...

environ 4 ans il y a

A résolu


Element-wise vector product (★)
Given two vectors x and y, compute their element-wise product z. Thus, if x = [1 3 5] and y = [0.5 -1 2], then z = [1*0.5...

environ 4 ans il y a

A résolu


Create a vector with n repeated values of a number x (★★)
If x=3 and n=7 then the vector y would be y=[3 3 3 3 3 3 3]

environ 4 ans il y a

A résolu


Swap the first and last columns (★★)
(copy of Prob 19) Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becom...

environ 4 ans il y a

A résolu


Make a checkerboard matrix (★★★★★)
(copy of Prob. 4) Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1...

environ 4 ans il y a

A résolu


Reindex a vector (★★)
(copy of Prob. 676) You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX h...

environ 4 ans il y a

A résolu


Sum of terms in a series 1 (★★★)
Given x and n, compute the following sum: |x|+|x|^(1/2)+|x|^(1/3)+|x|^(1/4)+|x|^(1/5) ... + |x|^(1/n) where ||x|| indica...

environ 4 ans il y a

A résolu


Median computation (★)
Given a vector of values, compute the median. The median is defined as the middle value in a set of *sorted* data. Thus, if ...

environ 4 ans il y a

A résolu


Triangle Numbers (★★)
(copy of problem 5) Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3...

environ 4 ans il y a

A résolu


Mid-term report
You just got your mid-term report, but it's full of ones and twos :(. So before you give it to your parents, you change it, in o...

environ 4 ans il y a

A résolu


Box
Give the volume of a box, x is equal to the body diagonal.

environ 4 ans il y a

A résolu


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 (...

environ 4 ans il y a

A résolu


Column Removal (★★★)
(copy of prob 7) Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2...

environ 4 ans il y a

Charger plus