Solved

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

4 mesi ago

Solved

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

4 mesi ago

Solved

Basic Quadratic Equation

Create the equation: y=(3x)^2+(5x)+35 and compute y for various values of x

4 mesi ago

Solved

Raise each element to the power of its index in a matrix

In a matrix, A = [1,2;3,4] raise the power of each element like: 1^1+2^3+3^2+4^4 and add it all to produce the result 274

4 mesi ago

Solved

Form a square matrix from four square sub-matrices

Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4): y = [x1 x2; x3 x4]; ...

4 mesi ago

Solved

Capitalized string operations

Convert the input sentence to upper case and replace all vowels with an underscore ('_')

4 mesi ago

Solved

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

4 mesi ago

Solved

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

4 mesi ago

Solved

Create tangent function out of sine function only

Please don't use cosine and tangent functions

4 mesi ago

Solved

Create tangent function out of cosine only

Please don't use tangent and sine functions

4 mesi ago

Solved

Solve equation numerically

y'=y In order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the metho...

4 mesi ago

Solved

Calculate inverse matrix in m by n matrix

x=(1:10)' y=roundn(2*x+7*rand(size(x)),-1) a*x=y Estimate a using inverse matrix calculation. This is principle of li...

4 mesi ago

Solved

Save variables

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

4 mesi ago

Solved

Solve system of equation!

Given provided system of equation, and find x and y. System of equation can be expressed as each term's coefficient. For exam...

4 mesi ago

Solved

Replace 0 to NaN!

In given matrix A=[1 nan nan; 2 2 nan; nan nan 1]; replace NaN to 0. Use matrix A as a input.

4 mesi ago

Solved

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)

4 mesi ago

Solved

Basic commands - amount of inputs

Make a function, which will return amount of given inputs Example: amountinput(1,2,4,3,10) -> 5 , because we gave functio...

4 mesi ago

Solved

angle in regular polygon

Make a function which returns measure of interior angle in x-side regular polygon. x is as input. Please pay attention, that 1 ...

4 mesi ago

Solved

Circular Shift Me

Given a vector v=[1 3 6 9 11], circular shift them while iterating m=[1 3 6 9 11; 11 1 3 6 9; 9 11 1 3 6; 6 9 11 1 3; 3 6 9 1...

4 mesi ago

Solved

Create a matrix X, where each column is a shifted copy of the vector v

Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

4 mesi ago

Solved

Replace values under a limit

For a vector x and number n, the goal is to find every element of x inferior to n and replace it by n. Example x= [ 1 2 3...

4 mesi ago

Solved

Matrix of almost all zeros, except for main diagonal

Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

4 mesi ago